Search  

CENTER ANIMATION IN BROWSER

HomeForumsFlash DiscussionCenter animation in browser
43940 Jolt
9 posts

Hi

I have a problem, in my code i have the following lines

my_anim.x = stage.stageWidth / 2; my_anim.y = stage.stageHeight / 2;

now when i test it (ctrl+enter) the anim is centered corectly, but when i publish it, the animation is a little off. i believe that it has something to do with stage.scaleMode. but i don’t know.

if i use the movie’s resolution in the index.html (width =’30’, height = ‘30’;) nothing happens, it loks normal, but if i use 100%(width = ‘100%’ height = ‘100%’;) the animation is off.

Thanks, Jolt

Posted 2 months ago
20955 digitalscience
1203 posts
Exclusive author Item was featured Author was featured Referred at least one person Sold between 100 000 and 250 000 dollars Bought between 10 and 49 items
my_anim._x = (Stage.width - my_anim._width) / 2; 
my_anim._y = (Stage.height - my_anim._height) / 2; 
Posted 2 months ago
43940 Jolt
9 posts
my_anim._x = (Stage.width - my_anim._width) / 2; 
my_anim._y = (Stage.height - my_anim._height) / 2; 

i don’t think this will work. this just centers the animation if the registration point is in the corner, mines is in the center of the animation.

p.s. in my initian post when i said i publish it and it is off, i mean that in the html it is off

Posted 2 months ago
41372 VF
235 posts
Exclusive author Item was featured Referred at least one person Sold between 5 000 and 10 000 dollars

Did you checked how the stage aligned?

stage.align = StageAlign.TOP_LEFT;
? Posted 2 months ago