We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Is there a way to export an image as a SWF in CS4 and have this SWF use code from main timeline?

arasburn asked
Medium Priority
Last Modified: 2012-05-11

I have created a series of standalone frames within a flash file, each one of which I need to export out as a SWF file.

These standalone frames do contain movieclips some of which animate, some are static and some need to be instructed to animate to demonstrate state changes etc.

In order to animate the movieclip I added code on the main timeline instructing the stage instance to gotoAndPlay from a specific frame within the movieclip. Running the animation normally, the code behaves itself...

However when you export the specific frame as an image, then save it as a SWF it ignores the code from the master timeline.

Is there a way round this please?

I experienced this same problem years ago and had to use Director to help fudge a solution, this is no longer an option.

My ideas to solve it include:
1) internalizing the code, putting it inside the mc so it hopefully picks up - early tests suggest this will work, however it is untidy and inflexible

2) use seperate movieclips for each state I need - a pain

3) write to experts and see if they have a good idea - excellent idea :)

To clarify... For example if I was to export frame 5 of my flash file as an image and save it as a SWF, that SWF would ignore the code on the master timeline. The code on the master timeline at frame 5 might be to tell a movieclip of a thermometer to play (showing increase in temperature).

The compiled SWF would show a thermometer movieclip but it would not play it.

movieclips that have animation within them play fine, and will stop if they have an internal timeline command asking them to do so.

Any help, greatly appreciated.
Watch Question

Top Expert 2011
Unlock this solution and get a sample of our free trial.
(No credit card required)


Hi dgofman,

Thanks for getting back to me. Unfortunately, I don't think this is quite what I need as the assets are all internal. I appreciate I could bring them into a blank movie with AS3 and as such would have much more control, but the main idea is to have the images in the timeline as a fast layout environment. Also I am in a team of three and whilst I am happy with AS2, none of us are particularly AS3 savvy and due to the project requirements we need to use AS3; the other two don't code at all.

I've had an idea to add switch code or conditional statements (if) to the internal timelines of the affected movieclips with the idea that if I can get them to read the parent frame label I can then instruct them to do what they should be doing on that frame.

I have done a bit of a test and exporting as a SWF image will allow for basic code to be executed within a movieclip - the test was to populate a text field with dummy text passed as a string; it worked.

Do you know how I can access the current root frame label from inside an MC please? I have looked online and tried FrameLabel but I am getting errors. I'm sure it is possible but I just can't quite get it.

i used an example from here:

and on the main timeline using his examples I can to a certain extent wrangle my way round the labels, however as soon as I dropped into an MC (and played with currentFrame etc) the whole thing broke down.

Any help greatly appreciated, thank you for the link, it looks really good in its own right and will undoubtedly help me improve my poor AS3 skills.

Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock this solution and get a sample of our free trial.
(No credit card required)


Not appropriate for my project / not what I was trying to achieve but an excellent idea
Top Expert 2011

I cannot understand why your team using AS2 :)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.