Solved

loadMovie removes attributes from empty MC

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Flash media server 1 335
Software Restriction Policy 8 882
Add 'birds singing' to homepage 5 115
Flash player updates using SCCM 2012 and SCUP 2011 3 461
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

740 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