A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: help with positioning loaded clips on stage resize

Threaded View

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    help with positioning loaded clips on stage resize

    Hi,

    I really don't understand how resizing works depending on the final screen scale, but I was passed this code where only one of the clips I'm loading remains where it should (sintonitzadorHolder). I thought the rest of the clips might not be repositioned because I was using the same movieClipLoader for all my clips in the movie, but I have just given them new names and still nothing changes whenever I switch my screen's resolution to test the file(On the contrary, they all reposition way off to the right side of the screen). Only the sintonitzadorHolder and they are all loaded in the same frame.

    I know i will also need to resize the clips, but I will worry about that when I have an idea of what is going on with the repositioning.

    How does this work?

    I keep visualizing an example with even proportions where the stage would be 200 x 200 and the loaded clip was a 50 x 50 square or a circle on a 10._x position. Then if the screen resized to 400 x 400 that would give me 400 - the original width of the loaded movie?

    The result is 350. Sorry if my post is not clear, I'm very confused with this and even though I have googled pretty much, most everywhere give the same explanation. The stage's width - the loaded movie's width. Sometimes divided by 2...

    Anyway, I will understand it if I get no reply. This is driving me "loco".

    Code:
    function StageResize()
    {
    	backGround._width = Stage.width;
    	backGround._height = Stage.height;
    	backGround._x = 0;
    	backGround._y = 0;
    	
    	digitalTimeHolder._x = Stage.width - digitalTimeHolder._width;
    	localTime._x = Stage.width - localTime._width;
    	pilotaHolder._x = Stage.width - pilotaHolder._width;
    	searchHolder._x = Stage.width - searchHolder._width;
    	clocksHolder._x = Stage.width - clocksHolder._width;
    	englishHolder._x = Stage.width - englishHolder._width;
    	spanishHolder._x = Stage.width - spanishHolder._width;
    	catalanHolder._x = Stage.width - catalanHolder._width;
    	sintonitzadorHolder._x = Stage.width - sintonitzadorHolder._width;
    }
    
    SizeListener = new Object();
    SizeListener.onResize = function()
    {
    	StageResize();
    };
    
    Stage.addListener(SizeListener);
    my page: http://webs.ono.com/jpdurba
    Last edited by capdetrons; 12-31-2013 at 08:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center