importing images dynamically

Posted on 2007-07-22
Last Modified: 2010-04-03
I have attached the swf with the probelm. I am importing images into a swf dynamically. All the images are for a  button movie with simple actionscript rollover functionality.

I am sure its a very simple problem but i cannot get it to work properly. It is importing the first image but not the other two. What am i doing wrong ??
Question by:headsy

    Author Comment

    the sample can be downloaded at
    LVL 12

    Expert Comment

    You are trying to load a image into a movieclip that only exists on frame two - when the movieclip is on frame one.

    The effect of this, is that Flash never finds exit2, thus it cannot load the image into the movieclip.

    A quick and dirty way to solve this is the following:

    1. Currently you have three keyframes at the same layer. Put each of these keyframes on different layers (frame 1 on the lowest layer, frame 3 on the highest), but at frame 1. For button 1, the work is done.
    2. For button two, you need to do a little bit more. Make a new keyframe at frame 2, and then go back to frame 1, and set the empty movieclips alpha to 0.
    3. Then do the same for button 3 - only here the keyframe will be at frame 3.

    What this does, is to ensure that the movieclip exit1-3 is ON stage when you try to load the images - so the images get loaded, their just invisible. Then, when the movieclip jumps to the different frames - the different images are shown.

    Good luck :)
    LVL 13

    Accepted Solution

    a fixed version in this link

    best regards

    LVL 12

    Expert Comment

    I'd advice you to try it yourself - better learning by doing

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now