My account
Shopping cart
Knowledge base
Support

Knowledge Base

Important! All new questions are usually answered within the next business day.

ActionScript Bridge

(views: 11402)  
ActionScriptBridge is a project that aims to fill the gap between AS2 and AS3. It gives the possibility for two Flash movies, one created using AS2 and the other using AS3, to communicate with one another (at least regarding function calls). This means that the AS3 clip will be able to call functions found in the AS2 clip loaded in it, and the AS2 clip will be able to call functions found in its’ parent, the AS3 clip. All this, by using two components: ASBContainer, for Flash CS3 and AS3, and ASBTerminal, for Flash MX 2004 or later and AS2.

ASBTerminal.addEventListener - method doesn't exist

(2007-10-29 - views: 9732)
Q:For example, the Help docs say to use:
[code]instanceName.addEventListener("status", listener);[/code]

But in my AS2.0 class I have a variable that is of type ASBTerminal and I get an error saying the addEventListener method doesn't exist.

[code]class com.eaxis.ReadingPane extends MovieClip
{

private var _asbTerminal:ASBTerminal;

function ReadingPane()
{
_asbTerminal.addEventListener( "status", this );
_asbTerminal.addEventListener( "ASBReturn", this );
}

private function status( evtObj:Object ):Void
{
if( evtObj.level == "status" ) trace( "Connection succeeded…" );
if( evtObj.level == "error" ) trace( "Connection failed…" );
}

private function ASBReturn( evtObj:Object ):Void
{
trace( "The AS3 function " + evtObj.functionName + " returned "+evtObj.value );
}

}[/code]

How should I accomplish this? If I remove the var type I avoid the error but the listener still doesn't work.

Thanks in advance for any help!
P.S. besides this little hiccup (which is most likely my lack of knowledge about the component), I've been pretty pleased with ASB!

Back

Login to add a question login to add a question