Search code examples
asp.net-mvc-3htmlhyperlinkflashswfobject

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?


Solution

  • 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 :)