Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updateAfterEvents()--loadMovie 1

Status
Not open for further replies.

ts2032

Technical User
Mar 26, 2002
115
0
0
US
I have a movie that loads a jpg image into a mc. What I try to do is center the mc depending on the size of the jpg.

I have two functions.
one called PlayOne and one called PlayTwo.
PlayOne loads the JPG and PlayTwo centers the mc. Why did I do it this way? When I tried to center the mc based on it's _width property in the same function (onPress), it always returned the previous jpg's width. When I call PlayOne on the press event of a button, and call PlayTwo on the release event of a button this works well and the image is centered to my specifications.
However, when I try to call the functions via setInterval, it does not center.

ie.. I have a function called PlayAll()--I know naming conventions...
function PlayAll(){

PlayOne();
PlayTwo();
}

The problem is when I call PlayTwo() to center the mc, the _width is the _width of the previous mc.

I have tried using updateAfterEvent() but with no success..

Any help, or ideas are appreciated...
tsmith

 
you have to wait until the jpg has fully loaded before you can get its width and height to center it

are you loading into an empty clip ?
 
No I am reloading it into the same clip.

I called the center function on the clips(load) event and it works fine.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top