Solved

Preloading images in Flash

Posted on 2009-04-02
2
522 Views
Last Modified: 2013-11-11
I am making a Flash app to rotate logos as can be seen on: http://www.james.nedlinux.com/logo_rotator.html.
The colored blocks are jpg images that represent company logos and they are loaded into the Flash application from an XML file using loadMovie.

How I implemented this:

I have a movieclip which is twice the size of my Flash file. The right part of the mc is not viewable because it is on the right of my viewport. I load every new logo into this right part. Then I play the mc that will move the logo into the viewport during 30 frames. The left part of the mc is now not viewable. Then I load the same logo into that left part, so I can move the mc back to the right in 1 frame without noticing. Then again a new logo is loaded... etc..

Problems:

1) Every logo is loaded twice everytime is it shown (appear and disappear). Is it possible to copy the content of a movieclip to another movieclip?
2) When the cyclus ends, I don't want to load all logos again for the next cyclus. How to fix that?
0
Comment
Question by:thijs321
2 Comments
 
LVL 12

Accepted Solution

by:
scooby_56 earned 500 total points
ID: 24052188
Do this in AS3 and the following applies

1)
you can use addChild to switch parents
for example... if myContainer1 has myLogoA and you want to move the logo to myContainer2 just use
myContainer2.addChild(myLogoA);

this will automatically remove from from myContainer1 and place inside myContainer2 effectively copying from one to another
2)
put logos into an array or some variable with meaningfull names. Even if you use removeChild(), the variable will still reference the logo and you can use it with addChild() later.
0
 

Author Comment

by:thijs321
ID: 24261147
Is it also possible in AS1 or AS2?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

743 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

12 Experts available now in Live!

Get 1:1 Help Now