• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 445
  • Last Modified:

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


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.
  • 4
  • 2
3 Solutions
arasburnAuthor Commented:
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.

arasburnAuthor Commented:
After exhaustive tests, I am now confident that 'Export Image' > 'SWF' will not process code in the same way as a full publish; which is what you would expect. All work arounds I have tried, including internalizing code within timeline (bad practice) still fall short.

Awarding half points to dgofman for getting back to me, his solution certainly would work, but it is not a solution I can use for this project.
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

arasburnAuthor Commented:
I am trying to award half points to dgofman for his help, and close the question. Not an easy/obvious process
arasburnAuthor Commented:
Not appropriate for my project / not what I was trying to achieve but an excellent idea
I cannot understand why your team using AS2 :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now