PDA

View Full Version : Position/Fullscreen



Masuki
February 16th, 2008, 07:45 AM
Hey guys,
i am new on the kirupa forum.
a friend of mine told me that you could help me maybe ;)
so here we go.

i want to do a fullscreenflashpage, okay thats not realy the problem ;)
but i want for example the navigation on the bottom-right and maybe a musicplayer on the left side at the top.
just an example: http://www.refune.com/index_main.html

so i can imagine, that the navigation and so on, so everything you want to get a postion on the screen, need to be a movieclip.

would be cool if you could help me.
kind regards from germany
Markus

excogitator
February 16th, 2008, 08:16 AM
stage.addEventListener(Event.RESIZE, resizeHandler);

function resizeHandler(event:Event):void {
myTextfield.text=myTextfield.text+"stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight+"\n";
}

=======================
Once you get the stageHeight and the stageWidth you can manipulate/animate and place your musicplayer and bottom menus, to their relative positions using the tween class

Masuki
February 16th, 2008, 09:13 AM
okay thanks
maybe this helps ;)
is it for AS2?
so what about this tween classes?

excogitator
February 18th, 2008, 03:01 AM
Well. Its actually AS3.
Cant give you the exact code right now but just the working of the tween class

import fl.transitions.Tween;
import fl.transitions.easing.*;
var myTween:Tween = new Tween(myObject, "x", Elastic.easeOut, 0, 300, 3, true);

where myObject would be your menu or player clip and you could change the values 0 and 300 to match the stage width logic.

Tween classes are good for actionscript where you just give the start coordinate and the end coordinate. You can play around with the parameters to get a better understanding of it.

Masuki
February 18th, 2008, 08:40 AM
okay
thanks
but is it possible in as2 too?
would be fine,... because the rest of the page would be in as2 too ;)

saion
February 18th, 2008, 04:46 PM
There is a good tweeninglibrary for this, that works in both as2 and as3, with some differences. download the library at http://code.google.com/p/tweener/.

// Max

excogitator
February 18th, 2008, 11:56 PM
Regarding your question. You can find similar code documented in the help section of AS2. Both the stage resize and tweening classes are available in AS2. As with regards to what saion has mentioned. Please feel free to try that out as well.