TwelvestoneFlash

Loadmovie problem (AS2)


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
The General
 
2011-02-28

So i got this loadmovie problem:

I want to load an JPG image into a movieclip (mov_cover) when the flashmovie starts Well that's the easy part but i need it to center in that movieclip. Those JPG images are never the same size.

Shouldn't be that hard but it driving me mad.

scudsucker
 
2011-02-28

I approach this by creating a new clip (inside mov_cover), loading the image into that, then when complete, placing the clip at minus half its width and height.

So if the loaded image is, say 300 x 200, you set the container clip to x,y of -150, -100

The General
 
2011-02-28

Thanks, but i'm already at this stage. The main problem is the different sizes of images. I need to somehow get the width and height of the image and pass that through to the movieclip.

DontBogartMe
 
2011-02-28

you can get the width and height of a JPG you've loaded, but only after it's fully loaded.

The thing to do I think is to create a holder clip that is invisible or off screen, in that create another holder into which you do loadmovie.

Check for when the JPG has loaded, then you can get the width and height, do your adjustments, and then make the main container visible again.

Have a look at this thread for code and tips: http://www.actionscript.org/forums/showthread.php3?t=57444

papaya nirvana
 
2011-05-23

if(move_cover._width >10) { move_cover._x = move_cover._width/2; move_cover._y = move_cover._height/2; }

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Loadmovie problem (AS2)