no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 1+ items on Envato Market
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…

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
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
  • Has been part of the Envato Community for over 7 years
  • Has collected 1+ items on Envato Market
annajaynehamilton says

Nope… not working…

166 posts
  • Has been part of the Envato Community for over 8 years
  • Has sold $1+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in 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
  • Has been part of the Envato Community for over 7 years
  • Has collected 1+ items on Envato Market
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
  • Has been part of the Envato Community for over 8 years
  • Has sold $1+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in 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
  • Has been part of the Envato Community for over 7 years
  • Has collected 1+ items on Envato Market
annajaynehamilton says

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

no-thumbnail
annajaynehamilton Recent Posts Threads Started
25 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 1+ items on Envato Market
annajaynehamilton says

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

116 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 7 years
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by