public static var _dispatcher:EventDispatcher = new EventDispatcher();
public static function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeekReferance:Boolean = false):void {
_dispatcher.addEventListener(type, listener, useCapture, priority, useWeekReferance);
}
public static function removeEventListener(type:String, listener:Function):void {
_dispatcher.removeEventListener(type, listener, false);
}
public static function hasEventListener(type:String):Boolean {
return _dispatcher.hasEventListener(type);
}
public static function sendEvent(type:String):void {
if(!ArrayTools.has(_dispatched_events, type)){
_dispatched_events.push(type);
}
_dispatcher.dispatchEvent(new Event(type));
}
public static function alreadyDispatched(type:String):Boolean {
return ArrayTools.has(_dispatched_events, type);
}
========================
just snipper from my framework. I can subscribe everything in every part of my code.
]]>i was looking for what data type the loaded object was. (var loadedObject)
turns out its an object. i was tryingeverything but
Thanks!
var myClipDepth:Number = 0
function CreateandRemove(){
if (myClipDepth > 1)
{
removeChildAt (myClipDepth);
}
var square:Sprite = new Sprite();
squarer.x = X_marge;
square.y = Y_marge_submapholder + 10;
addChild (square);
myClipDepth = getChildIndex(square);
trace ( “depth” + myClipDepth);
}
Now if you call the function it doesn’t throw errors all the time and You can start to give it some functionality.
]]>…but I have the opposite problem
I’d want to call a function in A from B.
Are you able to do it? thanks!
]]>nc = new NetConnection(); looks like it’s part of the commented line.
Thx again for sharing this excellent approach!
]]>