3 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United States
hitek says

I have a full screen flash web site and I am trying to load an external swf file into myLoader clip. The swf file loads in the middle of the stage like it should, but when i resize the page the swf moves to the bottom right and does not stay in the middle of the stage. How do I fix this? Here is my actionscript.. Thanks!

Stage.showMenu = false; Stage.align = “TL”; Stage.scaleMode = “noscale”; Stage.addListener( this ); function onResize(){

myLoader._x = Stage.width / 2 – myLoader._width / 2; myLoader._y = Stage.height / 2 – myLoader._height / 2; onResize();

}
116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Malaysia
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
  • Won a Competition
encryptme says

If myLoader contains animations starting from outside of the actual height or width, your intended height or width will no longer be the same.. thus causing it to not appear in the center of the screen. You should create a mask covering the stage size in that external swf, so when its loaded in the main swf movie it will read the correct size.

or you can just set a fake width & height for myLoader in the onResize, like :

Stage.showMenu = false; 
Stage.align = “TL”; 
Stage.scaleMode = “noscale”; 
Stage.addListener( this ); 

function onResize(){
myLoader._x = Stage.width / 2 – 600 / 2; 
myLoader._y = Stage.height / 2 – 300 / 2; onResize();
}
3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 more
wickedpixel says

one question… why the function onResize() is recalling itself?
function onResize(){
myLoader._x = Stage.width / 2 – 600 / 2;
myLoader._y = Stage.height / 2 – 300 / 2; onResize();
}

730 posts
  • Bought between 1 and 9 items
  • China
  • Elite Author
  • Exclusive Author
  • Has been a member for 7-8 years
  • Referred between 10 and 49 users
  • Sold between 100 000 and 250 000 dollars
wangruyi says

onResize() should out of {}

116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Malaysia
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
  • Won a Competition
encryptme says

haha yeah, didn’t notice that. it just needs to be triggered once. So you can put that outside of that function.

3 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United States
hitek says

Thanks encryptme its works perfect now! I have another question for you.. when resizing the page how can I make the bottom and top lines stop resizing once they go to a certain point on the stage. This web site is an example of what I mean http://www.drawingart.org/# the top and bottom will not overlap the content in the center of the stage. Anyone have any ideas?

Also If you watch when the web site loads the bottom will come sliding into place how is that animation done so that it always slides into the right place and sticks to the bottom of the web page?

Thanks!!

by
by
by
by
by
by