It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming Flash Forum

resizeListener HELP!

Moderator: Phate

resizeListener HELP!

Postby armofreek on Thu May 03, 2007 9:37 pm

First off, I would like to say that I am relatively new with action script, so this problem is probably something very simple that I have just overlooked with my novice-ness.

I have implemented this tutorial...
http://www.fireflytutorials.com/flash-tutorials/fullscreen-flash-movie/index
into my flash design which is a set of scrolling images at the top of my site with a white gradient mask on each side.

I stretched the flash file without warping using the tutorials' techniques, linking the left and right gradients to each side.

I then added the "var resizeListener..." so that the objects would stay on the edges of the window if it gets resized without having to refresh the page.

This is where i ran into my problem. The objects load on the edge of the window, but the flash file stays just as wide as it was loaded, no sticking to the edges...

Code: Select all
// positions objects to window edge //
Stage.scaleMode = "noScale";

var HPositioner:Number = (Math.round((Stage.width - 820) / 2));

function gradAlign () {
setProperty(rightGrad_mc, _x, (820 + HPositioner) - 0);
setProperty(leftSnap_mc, _x, 0 - HPositioner);
}

gradAlign();

// refreshes values on window resize //
var resizeListener:Object = new Object();
Window.addListener(resizeListener);

resizeListener.onResize = function () {
     gradAlign();
};


Any help would be GREATLY appreciated. Thank you :D
armofreek
 
Posts: 0
Joined: Thu May 03, 2007 9:17 pm

Return to Flash Forum

Who is online

Users browsing this forum: No registered users and 0 guests