[Flashcoders] MovieClipLoader, onLoadInit: not working properly / bug

2006-10-28 Thread Drew Shefman
I've run into an issue with MovieClipLoader, that I haven't been able to
find an mention of anywhere else online. 

The issue is with the onLoadInit firing before the first frame actionscript
has executed.  The issue was repeatable, but only on specific machines, and
ONLY through the browser. When played in the IDE or EXE then it worked as
expected. I personally was not able to see this error, but it happened
consistently on my client's internal network.

Here is the issue:

The external swf files have AS on frame 1:

//>
 var myClass:CustomClass = new CustomClass();
 function getInstance():CustomClass { return myClass;}

 var holder_mc:MovieClip
 var myMCL:MovieClipLoader = new MovieClipLoader(); 
 myMCL.addListener(this)

 function onLoadInit(p_target)
 {
var myInst:CustomClass = holder_mc.getInstance();
if (myInst == undefined) 
{
  trace("Error, your file doesn't contain the appropriate class");
}
else
{
//Working as it should
}
}

myMCL.loadClip("myUrl.swf",holder_mc);

 private var loadInitInterval:Number;
 private var doLoadInitCount:Number = 0;
 function onLoadInit()
 {
doLoadInit()
 }
 
 function doLoadInit()
 {

clearInterval(loadInitInterval);
var myInst:CustomClass = holder_mc.getInstance();
if (myInst == undefined) 
{
//Let's try waiting for a couple of frames
if (doLoadInitCount > 1)
{
trace("Error, your file doesn't contain the appropriate class");
}
else
{
var duration:Number = 1/30*1000 * 2 // wait for 2 frames at
30 fps
clearInterval(loadInitInterval);
loadInitInterval = setInterval(this,"doLoadInit", duration)
}
doLoadInitCount++
}
else
{
 //Working as it should
}
 }
//http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Weird OOP ability... Need a description of why, or at least some documentation

2006-06-01 Thread Drew Shefman
I ran across this really bizarre method access while reviewing someone
else's work.

I would like to look up some documentation for this syntax (it doesn't
have to be AS, it could be some other OOP language - if this is a standard
option that I haven't seen before)... or at least get a description of
why/how it works (other then the obvious - that it does).

Also, can anyone give any good reason to use this syntax?

I'm just confused by it.

Thanks!
Cheerio!
Drew Shefman
[EMAIL PROTECTED]

Notice that it does NOT use static's


class MyTestClass
{
function MyTestClass() {trace ("Created")}
public function runTest(){trace("running test")}
}
///
var myInst:MyTestClass = new MyTestClass();
MyTestClass(myInst).runTest();



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com