#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    1
    Rep Power
    0

    Make a flash video a link in CS5.5


    Hello all,

    This has probably been asked before but I didn't find anything in my searches for the text in my title. I am a newb in the flash world, I normally do PHP and JSP, but I have one website that I am working on that has a flash video logo. The only thing they want me to change about the video is to make it a link to the index page of the site. I can not figure out for the life of me how to do this. Could someone please lay the steps out in a simple fashion for me. I have found a few tutorials online but none of them were for CS5.5 and none of them have all the steps for the version they are for. They were all missing something and I can't figure out what that something is as I have no training in Flash. Please help me.

    Any help will be greatly appreciated.

    Thanks,

    mojo
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3165
    Hi, the navigateToURL function is what you are after.

    How you implement it kinda depends on how your stage is setup. The easiest catch-all way is:
    • Draw a large rectangle over the top of all your logo content. Right click that and choose "Convert to Symbol". Give it a name and set the dropdown to MovieClip.
    • Select the new rectangular MovieClip on the stage and open the Properties panel.
    • You will see a blank text field with the words "<Instance Name>" written in it. Let's call the clip home_link.
    • Still in the properties panel, expand the "Color Effect" section and set the dropdown to "Alpha", then drag the slider down to 0. This will make the rectangle transparent so you can't see it but it can still be interacted with.
    • Now select the keyframe that the rectangle sits on in the timeline and open the ActionScript panel.
    • Paste in this code and change the link to your homepage:
    • Code:
      import flash.net.navigateToURL;
      import flash.net.URLRequest;
      import flash.events.MouseEvent;
      
      // This line makes it have the hand cursor when the mouse is over the rectangle.
      home_link.buttonMode = true;
      
      // Sets up the event listener so that when the rectangle is clicked, goHome is called.
      home_link.addEventListener(MouseEvent.CLICK, this.goHome);
      
      function goHome(event:MouseEvent):void
         {
            // Link to go to and the window/frame name to load in i.e. _self, _blank etc.
            navigateToURL(new URLRequest("http://www.example.com"), "_self");
         }
    Quis custodiet ipsos custodes?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Location
    Kansas
    Posts
    14
    Rep Power
    0

    Error


    I seem to get the following errors when I try this:

    The class or interface 'MouseEvent' could not be loaded.
    The class or interface 'flash.net.navigateToURL' could not be loaded.

    Any ideas what these errors mean?

    Please help me.
  6. #4
  7. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3165
    It either means you didn't copy and paste the import statements or that you are using ActionScript 2. I assumed you were using ActionScript 3 since you made a point of saying you are using CS5.5, you can check that by doing File->Publish Settings->Flash and then seeing what is selected in the ActionScript dropdown.
    Quis custodiet ipsos custodes?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Location
    Kansas
    Posts
    14
    Rep Power
    0

    Thanks you have been very helpful


    I am sorry the original video was created by someone else and I am just trying to edit it. I purchased CS5.5 because it was the latest and it would be able to work with any of the previous versions.

    I confirmed that the video appears to be using 2.0 by following your instructions. I am sorry for the confusion I just do not know anything about Flash and I surely didn't know it would be this hard. Will you please help me?

    If I were using action script 3.0 I know your instructions would have worked as I was able to find everything you were describing and complete all the steps. Since I understand nothing about flash what do I have to do differently for action-script 2.0 versus 3.0?

    Oh, and thank you very much for being so detailed you are the best!
  10. #6
  11. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3165
    hehe, not to worry. All the steps are the same except the last one which uses different code. Here's the equivalent in ActionScript 2:
    Code:
    home_link.onRelease = function():Void
       {
          getURL("http://www.example.com", "_self");
       }
    That replaces all of the code I wrote in the previous post including the imports. So to be ultra clear, don't use any of the previous code, just use the bit I just wrote ^_^
    Quis custodiet ipsos custodes?
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Location
    Kansas
    Posts
    14
    Rep Power
    0

    Thanks


    Thank you that worked! You are awesome!!!!
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    ... link not linking !


    Hi Tann San,

    I have used your code (using AS 3.0), and when the flash animation is run the mouse hand changes when hovering in the correct place, however when I click nothing happens - it just does not link to another page!

    I have tried moving the slider to "HIT" and just about everything I can think of!

    Please advise - help would be greatly appreciated!.

    Many thanks.

    osmildmay

IMN logo majestic logo threadwatch logo seochat tools logo