The problem is that different versions of swf are released and versions are incompatible.
How to obtain the number of frames for external SWF loading in AS3
I want to copy B. SWF in a.swfand get B. swf's current frame and total frame number, and display B. SWF playback in a schedule.
But the number of frames cannot be obtained to B .swf
My code is as follows:
Import flash. display .*;
Import flash. events .*;
Import flash.net. URLRequest;
// Variable Declaration
Var contentSwf: MovieClip;
Var url: String = "gk01.swf ";
Var loader: Loader = new Loader ();
// Loader. contentLoaderInfo. addEventListener (ProgressEvent. PROGRESS, mcLoading );
Loader. contentLoaderInfo. addEventListener (Event. COMPLETE, loadedHandler );
Var request: URLRequest = new URLRequest (url );
Loader. load (request );
AddChild (loader );
Function loadedHandler (event: Event): void {
Trace(event.tar get. content );
Trace(event.tar get. loader. content );
ContentSwf = movi((event.tar get. loader. content );
Trace (contentSwf. totalFrames );
}
Compilation error:
[Object AVM1Movie]
[Object AVM1Movie]
TypeError: Error #1034: forced conversion type failed: The flash. display: AVM1Movie @ 1118bpc3 cannot be converted to flash. display. MovieClip.
At class_as3_fla: MainTimeline/loadedHandler ()
In flash player, AVM1 and AVM2 cannot communicate with each other. My program is correct, but the external SWF file I load is compiled by flash 8, CS3 cannot access its attributes. Modify the attributes of the externally loaded SWF file and release the file with CS3 again.
Crashed. It took more than an hour to call ~~~