no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
annajaynehamilton says

It seems that no matter what I do, I can’t get my flash site to publish in the center of the screen. I’ve tried coding it, I’ve changed the Publish Settings, but it’s not working.

I got a little ambitious and tried to make the background automatically resize. That didn’t work… And I can’t even do anything as simple as center it on the screen.

Here’s the code I used:

 Stage.scaleMode = "noScale" 
Stage.align = "T" 
stop();
sizeListener = new Object();
sizeListener.onResize = function() {
centered._x = Stage.width/2
centered._y = Stage.height/2
centered._width = Stage.width * .5
};
Stage.addListener(sizeListener);

I know the Flash-gurus on this site must get sick of people like me always wanting help. But I’m totally stuck (as usual) and I’ve tried every other source I can think of…

3069 posts
  • 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
  • Romania
wickedpixel says

try with this…
Stage.align = “TL”
... means that the top left of the screen has the coordinates 0, 0

no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
annajaynehamilton says

Nope… not working…

166 posts
  • Bought between 50 and 99 items
  • Has been a member for 7-8 years
  • Sold between 1 and 100 dollars
  • United States
johnhoysa says

In your html is it set to 100% instead of a pixel size for dimensions?

Is it possible to share a link to what you are working on?

no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
annajaynehamilton says

Yeah… I did the 100% thing.

I haven’t got a server to publish the site yet…

I’d be happy to share the files if that would help….

166 posts
  • Bought between 50 and 99 items
  • Has been a member for 7-8 years
  • Sold between 1 and 100 dollars
  • United States
johnhoysa says

sure toss me an email via my profile page and i ll see what i can do. might take me a little to find the time to help out though.

no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
annajaynehamilton says

Thanks, any help is appreciated. Just whenever you get the time.

no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
annajaynehamilton says

If anyone else has any suggestions, I’m totally open….

116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
trepn says

What kind of object is centered and what are its original dimensions?

asking this because I don’t know why you resize it by the stage value.

I usually do:
centered._x = (Stage.width-centered._width)/2;
centered._y = (Stage.height-centered._height)/2;

3868 posts
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 7-8 years
+4 more
flashjunkie says

to automatically resize instantly try using the same code but outside of the function like this…

 Stage.scaleMode = "noScale" 
Stage.align = "TL" 
stop();
sizeListener = new Object();
sizeListener.onResize = function() {
centered._x = Stage.width/2
centered._y = Stage.height/2
centered._width = Stage.width * .5
};
Stage.addListener(sizeListener);
centered._x = Stage.width/2
centered._y = Stage.height/2
centered._width = Stage.width * .5

Jay

by
by
by
by
by
by