335 posts
  • Sold between 10 000 and 50 000 dollars
  • Author had a Free File of the Month
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Bought between 100 and 499 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
+3 more
tiam says

As the topic says im having major problems aligning my dynamicly imported swf file center on the stage.

The swf goes in the desired place when i resize the window but when first loading the swf it doesnt come in right place. Instead the top left corner of the imported swf is centered. Keep in mind that it is working when window is resized…

My assumption is that the movie (swf) loaded is using its own TL alignment (default) and when resize the listener sets in from tha main movie. If that is the case how do i remove the TL from the moviclip… or is there any way to use global alignement…

Help please!!

If someone is willing to help me with this i would gladly pay for it!!

582 posts
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
SparkyFlash says

You need to load external swf into a container inside your main.swf file. After its loaded, call onResize function that handles all the alignment of the container and other elements on stage.

335 posts
  • Sold between 10 000 and 50 000 dollars
  • Author had a Free File of the Month
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Bought between 100 and 499 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
+3 more
tiam says

Hi SparkyFlash! Thanks for your answer!! I do load the swf inside a movieclip in the maintimeline (mainmovie). How would I call the onResize onLoad or after load..?

1612 posts
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 more
DaniMun says
How would I call the onResize onLoad or after load..?

http://www.gotoandlearn.com/play?id=31 :D

335 posts
  • Sold between 10 000 and 50 000 dollars
  • Author had a Free File of the Month
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Bought between 100 and 499 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
+3 more
tiam says

Thanks DaniMun! Not exactly what I was looking for but a good tutorial though!! :)

I was thinking maybe there is a way to call a stagehandler without actually resizing the stage??

1612 posts
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 more
DaniMun says
Thanks DaniMun! Not exactly what I was looking for but a good tutorial though!! :)

Don’t mention it ;)

I was thinking maybe there is a way to call a stagehandler without actually resizing the stage??

Short answer: maybe.
Long answer: it greatly depends on your stage handler method implementation.

In order for other fellow authors to be able to help you, go ahead and post your code using Pastie ;)

335 posts
  • Sold between 10 000 and 50 000 dollars
  • Author had a Free File of the Month
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Bought between 100 and 499 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
+3 more
tiam says

Here is a link to the some of the code :)

http://pastie.org/613651

1612 posts
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 more
DaniMun says
Here is a link to the some of the code :)

http://pastie.org/613651

Well I’m about to leave my office so unfortunately I don’t have the necessary time to look into your code more closely, but as far as I can see, the initial alignment issue is due to the fact that you’re loading an external asset into an empty movieclip.

Of course I might be wrong, like I said, I’m about to leave :)

If I was you, I’d drop that code and create a resize handler method from scratch, such as this one

Hope this helps ;)

335 posts
  • Sold between 10 000 and 50 000 dollars
  • Author had a Free File of the Month
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Bought between 100 and 499 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
+3 more
tiam says

Thanks a lot for your help:) Ill try some more things before I drop my code and try something else. I cant be the ony person facing this problem I hope …;)

8192 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX Volunteer moderator says

very quickly looking at it I think it may be because the SWFs width / height is 0 / 0 before its initialised…?

maybe place a movieclip alpha = 0 as the background of the swf and try that…?

by
by
by
by
by
by