Jump to content


Center Loaded jpeg to MovieClip


  • You cannot reply to this topic
1 reply to this topic

#1 ccbass85

    Young Padawan

  • Members
  • Pip
  • 86 posts
  • Gender:Male
  • Location:Maryland

Posted 17 April 2008 - 09:22 PM

ok so i got a little dilema. ive seen the tutorials on centering a jpeg to a movie clip when its loaded but they are actually cheating . All they do is load it in the center of the stage and not the center of the actual movieclip. This was working fine untill i decided to upload it on the web. And now its all screwed up because i think its trying to recalcuate what the "center" of the stage is everytime u resize ur broweser window. For anyonen who doesnt know the code im talking about here it is:

_root.container._x = Stage.width/2;
_root.container._y = 50;
_root.container._alpha = 0;

_root.onEnterFrame = function() {
if (_root.container._width>0) {
delete _root.onEnterFrame;
_root.container._x -= _root.container._width/2;

}
};

Is there a better "proper" way of doing this? Im surprised Adobe didnt fix this in cs3...
Any help or points in the right direction would be really appreciated.. Thanks guys!!

oh yea heres the link if u want to see what i mean. Click on illustration and then click on the different pieces. This is reeeaaally wierd... http://www.7splat.com/

#2 ccbass85

    Young Padawan

  • Members
  • Pip
  • 86 posts
  • Gender:Male
  • Location:Maryland

Posted 17 April 2008 - 10:13 PM

OK. i figured it out nm guys. Instead of defining the center as Stagewidth i actually jus wrote in numbers how big the stage was and divided that by 2. it worked perfectly since that number is always consistent :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users