Jeyhun Rahimov
Jeyhun Rahimov

Reputation: 3787

How make .swf file is as link?

I use .swf file in may site:

<div>
    <object width="100%" height="100%">
    <embed  src="@Url.Content( "~/Content/TopRight.swf" )"  type="application/x-shockwave-flash" width="310" height="95"></embed>
    </object>
</div>

And I want when click this banner, opens any link (any page). I placed <object> into <a> tag, but nothings changed. How can I do this?

Upvotes: 0

Views: 622

Answers (1)

Ryan Hollingsworth
Ryan Hollingsworth

Reputation: 381

put this at the end of your code:

import flash.display.MovieClip;

var hit = new MovieClip();
hit.graphics.beginFill(0xFFFFFF);
hit.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
var clicky = new SimpleButton(null,null,null,hit);
this.addChild(clicky);

clicky.addEventListener(MouseEvent.CLICK, function(){
    navigateToURL(new URLRequest("http://google.com"));  
});

should work :)

Upvotes: 1

Related Questions