-
Help with changing code from AS2 to AS3
Hi,
I just got the new Flash CC and am not used to AS3 coding.
Would someone be able to help me changing this code so it will work in AS3?
It is for an expandable banner on a webpage *..
Stage.scaleMode="noScale";
Stage.align = "TR";
expand1.onRelease = function () {
getURL("javascript:resizeobj('cascade',970,460)");
gotoAndPlay("cascade1");
}
Thank you!
* It is a banner that looks a little like the one on this page: http://www.cbssports.com/?adTargetin...i_demo_cascade
I want to add the 3d style unfolding to it like in the example and to do so I need to use the 3D rotation tool which has to be AS3.
Cheers,
-
Originally Posted by J_83
Hi,
I just got the new Flash CC and am not used to AS3 coding.
Would someone be able to help me changing this code so it will work in AS3?
It is for an expandable banner on a webpage *..
Stage.scaleMode="noScale";
Stage.align = "TR";
expand1.onRelease = function () {
getURL("javascript:resizeobj('cascade',970,460)");
gotoAndPlay("cascade1");
}
Cheers,
I'll admit I don't know what the getURL link is doing, maybe some kind of external call to a cascade function?
Everything else however -
//just different syntax
stage.align = StageAlign.TOP_RIGHT;
stage.scaleMode = StageScaleMode.NO_SCALE;
expand1.addEventListener(MouseEvent.CLICK, onClick); // add a listener to call the function
function onClick(e:MouseEvent):void {
// do something equiv to getURL javascript call
gotoAndPlay("cascade1");
}
hope that helps
- Brian
-
.
Hi,
Does this help you?
PHP Code:
import flash.external.ExternalInterface;
import flash.events.MouseEvent;
stage.align = StageAlign.TOP_RIGHT;
stage.scaleMode = StageScaleMode.NO_SCALE;
expand1.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
if (ExternalInterface.available)
{
ExternalInterface.call("resizeobj", 'cascade',970, 460);
}
else
{
trace("No cigar");
}
//gotoAndPlay("cascade1");
}
or if you want to try a more traditional type url then look here http://snipplr.com/view/15367/naviga...ascript-popup/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|