CHINOS
asked on
Scale, Align / Position, Full Screen w1th Flash AS3
Hello,
I'm fairly new to Action Script and Flash and I just bought this file to help me align and scale everything in my own website but its code is all in AS2.
I am trying to convert the following AS2 code to AS3 for my website.
I'm fairly new to Action Script and Flash and I just bought this file to help me align and scale everything in my own website but its code is all in AS2.
I am trying to convert the following AS2 code to AS3 for my website.
// Aligns everything to the top left side
Stage.align = "TL";
// Disables the movie from scaling
Stage.scaleMode = "noScale";
// Start values
back._width = Stage.width;
//Bacground width is equal to Stage width
back._height = Stage.height;
//Bacground heigth is equal to Stage height
info1._x = Stage.width/2;
//info1 _x location is Stage width divided by 2
info1._y = Stage.height/2;
//info1 _y location is Stage height divided by 2
info2._x = Stage.width/2;
//info2 _x location is Stage width divided by 2
info2._y = (info1._y - (info1._height/2))/2;
/*info2 _y location is info1's location minus (info2 height divided by 2) and all
this divided by 2*/
info3._x = info1._x + (info1._width/2) + 20 + info3._width/2;
//I left this for you to write heir (sort of like practise/homework)
info3._y = info1._y + (info1._height/2) - info3._height/2;
//I left this for you to write heir (sort of like practise/homework)
info4._y = Stage.height - Stage.height/3;
//info4 _y location is Stage height - 1/3 of stage height
/*The reason the is NO info4 _x location is because we have put info4 10px from the
edge, and since we aligned this all to Top LEFT it does not need a code */
// End of Start values
// Listens to if the browser if resized
sizeListener = new Object();
sizeListener.onResize = function() {
/* Code that will RUN when the browser is resized (basically just copy the
code above)*/
back._width = Stage.width;
back._height = Stage.height;
info1._x = Stage.width/2;
info1._y = Stage.height/2;
info2._x = Stage.width/2;
info2._y = (info1._y - (info1._height/2))/2;
info3._x = info1._x + (info1._width/2) + 20 + info3._width/2;
info3._y = info1._y + (info1._height/2) - info3._height/2;
info4._y = Stage.height - Stage.height/3;
};
Stage.addListener(sizeListener);
// End of code
ASKER
Ok,
While this code did run in AS3 it didn't help me get the effect I'm looking for.
This is what the code did in AS2
http://www.flashden.net/files/11492/preview.swf
I am trying to achieve the same effect in AS3. This is what it looks like with the converted code above
http://www.docaroundtheclock.org/timtab/as3test/sa.html
the box on the left is info4
the box on the right is info3
the box on the top is info 2
the box in the middle is info1
and the background is a movie clip called 'back'
If you like I can post/email the file but I purchased it so I'm not sure if I should post the file here.
While this code did run in AS3 it didn't help me get the effect I'm looking for.
This is what the code did in AS2
http://www.flashden.net/files/11492/preview.swf
I am trying to achieve the same effect in AS3. This is what it looks like with the converted code above
http://www.docaroundtheclock.org/timtab/as3test/sa.html
the box on the left is info4
the box on the right is info3
the box on the top is info 2
the box in the middle is info1
and the background is a movie clip called 'back'
If you like I can post/email the file but I purchased it so I'm not sure if I should post the file here.
change this data on line 35
stage.addEventListener(Eve nt.RESIZE, resizeStageHandler);
to this
this.stage.addEventListene r(Event.RE SIZE, resizeStageHandler);
GE
speraspearpro@yahoo.com
if it does not work so i can have a look at it.
stage.addEventListener(Eve
to this
this.stage.addEventListene
GE
speraspearpro@yahoo.com
if it does not work so i can have a look at it.
ASKER
Ok, I'll email it to you right away, that didn't work.
Thanks so much for your help!!
Thanks so much for your help!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that should work
ASKER
Thank you soooo much!!! I love it!
GE
Open in new window