Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FullScreen flash... problem with movieClip position

    Hey,

    I'm currently programming a site available to see at:

    http://biddleinc.ca/empiregrill/

    The problem i have is that when I load in external .swf files which are bigger than the main centered movieClip (centeredContent_mc)... if you resize the browser it will bump the center section to a new position because it's size has changed. You can see this in the "Take a tour" section.

    This is the code im using:

    Code:
    Stage.scaleMode = "noScale";
    Stage.align = "TL";
    
    var stageListener: Object = new Object();
    
    stageListener.onResize = positionContent;
    
    Stage.addListener(stageListener);
    
    
    function positionContent():Void
    {
      centeredContent_mc._x = Stage.width/2 - centeredContent_mc._width/2;
      centeredContent_mc._y = Stage.height/2 - centeredContent_mc._height/2;
      
      
    	if ( Stage.height/Stage.width > background_mc._height / background_mc._width )
    	{
    		var ratio = background_mc._width/background_mc._height;
    		
    		if ( Stage.height > 400 )
    		{
    			background_mc._height = Stage.height;
    			background_mc._width = Stage.height*ratio;
    		}
    	}
    	else
    	{
    		var ratio = background_mc._height/background_mc._width;
    
    		if ( Stage.width > 400 )
    		{
    			background_mc._width = Stage.width;
    			background_mc._height = Stage.width*ratio;
    		}
    	}	
    }
    
    positionContent();
    My question is: Is there any way to specify the new movieClip and keep if from changing the size of the mc it's being loaded into?

    I would GREATLY appreciate any comments!!!!

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    I think that it automatically resizes the movieClip to fit the SWF. What you probably will have to do is reset the size after it is loaded using something like right after the loading code (not displayed above):

    Code:
    innerSWF._x = 500;
    innerSWF._y = 400;
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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