Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Friday, May 21, 2010

AS 3.0 : Google clickTag

Do you need a Google ClickTag that's coded in AS3? Then grab and bite the following Nyum-nyum codes:


YourBtnName.addEventListener(MouseEvent.MOUSE_UP,ClickThru);

function ClickThru(e:MouseEvent):void {

if (root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:") {

navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG),"_blank");

}

}



Courtesy of David Stiller, Co-author, Foundation Flash CS3 for Designers

Wednesday, April 1, 2009

Flash Liquid Layout

I have updated the 'Liquid Layout' recipe from Tutorio to AS3. 

Step 1. Ensure the HTML publishing setting in your Flash IDE at 100% height and 100% width. Align at top left.

Step 2. Copy and paste the following into the 1st Frame of the timeline. Make adjustments where necessary:


stage.addEventListener(Event.RESIZE, repositionElements)
//
function repositionElements(myevent:Event):void{
trace(stage.stageWidth);
trace(stage.stageHeight);
//'Box' being your movieclip or artwork
Box.y=stage.stageHeight-40;
}