Solved

Preloading images in Flash

Posted on 2009-04-02
2
525 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't play a movie website which used to be playable 4 660
Adobe flash player fails to install 12 314
black magic design 1 130
Play RTMP without Flash 3 658
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

821 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