Copy link to clipboard
Copied
I have created a .fla with a timeline and layers that called external swfs (who in turn load xml data) and it worked fine, except that I lost the .fla code and had just the .swf code.
Found a website that decoded the .swf into a .fla and discovered what I have been looking for all the time, a way to code a timeline instead of drawing it out.
But now when I save the script as MovieClass.as, and call it from frame 1 of my .fla, not only do I not get any errors, but no output.
As per one forum that I did find, I did declare the Document class as MovieClass in the ActionScript Settings, but no joy.
Googling and searching the forums here has not proved fruitful.
My AS code
package
{
import flash.display.*;
import flash.net.*;
public dynamic class MovieClass extends movieclip {
public var myLoader:Loader;
public var url:URLRequest;
public var my2ndLoader:Loader;
public var url2:URLRequest;
public var my3rdLoader:Loader;
public var url3:URLRequest;
public var my5thLoader:Loader;
public var url5:URLRequest;
public var my6thLoader:Loader;
public var url6:URLRequest;
public var my7thLoader:Loader;
public var url7:URLRequest;
public function MovieClass(){
addFrameScript(1, this.frame2, 149, this.frame150, 299, this.frame300, 300, this.frame301, 448, this.frame449, 455, this.frame456, 604, this.frame605, 753, this.frame754, 1256, this.frame1257);
}
function frame2(){
this.myLoader = new Loader();
this.url = new URLRequest("RMCurrent.swf");
this.myLoader.load(this.url);
addChild(this.myLoader);
}
function frame150(){
this.my2ndLoader = new Loader();
this.url2 = new URLRequest("RMPrevious.swf");
this.my2ndLoader.load(this.url2);
addChild(this.my2ndLoader);
removeChild(this.myLoader);
}
function frame300(){
removeChild(this.my2ndLoader);
}
function frame301(){
this.my3rdLoader = new Loader();
this.url3 = new URLRequest("SPCurrent.swf");
this.my3rdLoader.load(this.url3);
addChild(this.my3rdLoader);
}
function frame449(){
removeChild(this.my3rdLoader);
}
function frame456(){
this.my5thLoader = new Loader();
this.url5 = new URLRequest("SPStats.swf");
this.my5thLoader.load(this.url5);
addChild(this.my5thLoader);
}
function frame605(){
this.my6thLoader = new Loader();
this.url6 = new URLRequest("RMStats.swf");
this.my6thLoader.load(this.url6);
addChild(this.my6thLoader);
removeChild(this.my5thLoader);
}
function frame754(){
this.my7thLoader = new Loader();
this.url7 = new URLRequest("rmsummary.swf");
this.my7thLoader.load(this.url7);
addChild(this.my7thLoader);
removeChild(this.my6thLoader);
}
function frame1257(){
removeChild(this.my7thLoader);
}
}
}
//package MovieClass
frame one of MovieClass.fla
include "MovieClass.as";
MovieClass.as, MovieClass.swf and all the called swfs are in the same directory.
Are there any debug steps that i can do to troubleshoot this, or have i forgot something glaringly obvious?
Thank you
Copy link to clipboard
Copied
to start, if you're not seeing errors when trying to use that class file, you're not using that class file. ie, movieclip should be MovieClip.
next, do you have those swfs that are supposed to load? if so, what's the problem?
Copy link to clipboard
Copied
I would have to say that it is calling the right .as because if I change "public dynamic class MovieClass extends movieclip" to "public dynamic class MovieClassx extends movieclip", I get the compile error
Y:\MovieClass.as, Line 1 5008: The name of definition 'MovieClassx' does not reflect the location of this file. Please change the definition's name inside this file, or rename the file. Y:\MovieClass.as
All the swf can be opened individually, and they display the right data (read the data from XML files).
Copy link to clipboard
Copied
you should get a compiler error because there is no movieclip class.
Copy link to clipboard
Copied
addFramescript() only works if you have frames.
Just sayin'
Find more inspiration, events, and resources on the new Adobe Community
Explore Now