• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Duplicate MovieClip in AS3

Participant ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

I am developing an iOS app within Flash Builder 4.5.

My application loads a library of graphics. The library of graphics is composed of a bunch of movieclips sitting on the main timeline which has only a single frame.

I then parse through all the children and in correlation with an XML structure, i determine whether :

1 - i will draw the child as a bitmapData and save it in memory to later on reinstantiate it as often as possible

2 - keep the childs constructor class to later reinstantiate it as a movieClip object.

Unfortunately, i can't put linkage classes in a loaded SWF. therefore the constructor class of #2 is always movieclip.  When i try to recreate it, i always get an empty movieClip.

Is there a way to copy the entire timeline of a loaded movieClip that doesn't have a linkage identifier?

Thanks in advance.

TOPICS
ActionScript

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

you have a library swf that contains movieclips on its single frame timeline, correct?  each of those movieclips are assigned a distinct class, correct?

you want to load that swf into a main swf and create instances of those loaded movieclips in your main app, correct?

if all that's correct, is there anything else?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

I can't assign a distinct class to each of the MovieClips unfortunately since loading linked classes in the iOS application is not permitted.  I can only load a swf that has no code whatsoever.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

you don't need any code in the loaded swf.  you just need movieclips that have class names if you want to duplicate/create those class instances.  can you load a swf that contains movieclips exported for actionscript with class names?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

In order for the movieclip to have a class name, i need to assign a linkage, in which case, will result in compiled actionscript.

When running the application on an iOS,i get the message

"Your application is attempting to run uncompiled ActionScript, probably due to the use of an embeddedSWF.  This is unsupported on the iPhone."

I only get this message as soon as I assign a linkage to a symbold in a SWF that I load.

I've also tried to use byteArrays.  But the length is alway 0 when attempting to

byteArray:writeObject(loadedSwfSymbol)

meaning it reads nothing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

LATEST

then you won't be able to load and use classes in an external swf.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines