The reason why flash. display: AVM1Movie cannot be converted to flash. display. MovieClip

Source: Internet
Author: User

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 ~~~

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.