A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: on click?

  1. #1
    Senior Member
    Join Date
    Oct 2004
    Posts
    165

    on click?

    What is the appropriate action script code so that when i click on a picture then a pdf that is linked to that picture opens in the browser and is ready to be printed!

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    106
    I dont know if you are looking for as2 or as3, but here is the solution from AS3 code snippets:
    1)turn your picture into a MovieClip Symbol F8
    2)Give your movieclip the instance name "thePicture"
    3)Change www.adobe.com to the URL for your .pdf file this can be an absolute link or relative link if the PDF and .swf file are in the same folder structure.

    Code:
    thePicture.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
    
    function fl_ClickToGoToWebPage(event:MouseEvent):void
    {
    	navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center