Solved

loadMovie removes attributes from empty MC

Posted on 2007-04-08
4
274 Views
Last Modified: 2008-02-01
I'm loading images during runtime into empty movie clips(create with createEmptyMovieClips method). Each image has an associated id number which I push onto an array:

var idArray = new Array('1','2','3','4','5');

So now the timeline has an array and 5 movie clips with instance names: for example:  id18, id22, id31, id45, id52

What I want is to, using AS, fade these images in sequence, while id1 fades out I want id2 to fade in, and so on...then have it loop back to 1 when id5 fades out.

Right now I have a varible pos (for position) a movie clip looping infinitely checking to see if the current positions _alpha > 0. I'll stop here because I hit a problem:

My problem is, after the loadMovie('someimage.JPG',_root.id18) finishes, the MC id18._alpha is reporting undefined. Why did loading an image erase this value? The debugger confirms that no values exist in any attributes, yet the image appears fine.

Anyhow, if I could figure that out then my looping MC could increment the _alpha values and loop through the array..unless there is a more elegant solution.
0
Comment
Question by:jstretch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 18873965
point here is:

If movieClip is loading an image or SWF externally, you can set property of the movieClilp instance only after it gets loaded completely.
so you need to keep checking if it gets loaded completely then set the value.


- Aneesh Chopra
0
 
LVL 6

Author Comment

by:jstretch
ID: 18873991
So after it loads (completely) I have to set all its attributes? Meaning, flash does not detect and set the attributes for the MC such as _width, _height, _alpha...correct?
0
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 18874001
yes,
all attributes of a movieClip get losts (except _x and _y) as you load an external JPG or SWF in it..
although it can be set again after loading completion.

- Aneesh Chopra
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 18874003
also variables/functions Movieclip holds get lost.

- Aneesh Chopra
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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 my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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 how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

622 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