Solved

loadMovie removes attributes from empty MC

Posted on 2007-04-08
4
273 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

738 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