SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member jgwebdesigner's Avatar
    Join Date
    Oct 2009
    Location
    Mechanicsburg, PA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash links over top of image text

    I've created a fade-in fade-out slideshow of sorts. It has 3 images that each have their own motion tween that makes them fade in/fade out at different times. 2 of the images have text and I would like to create a couple of them into links -- they are static images (I didn't create the text in Flash, I imported the images into my library). How do I create an image map or something that is transparent so when you click on that text a new page pops up with my URL?

    And once I create the image (however I do that...) I know I have to select it and place this :

    on(release)
    {
    getURL("#", "_blank");
    }

    in the actionscript window....
    Can someone help me??

  2. #2
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just convert the image into a movieclip or if you need just a portion of the image to be clickable, then place a transparent movieclip on top.
    Tweep List adds an avatar menu to Twitter (open source)
    Word Stats shows your most used words on Twitter

  3. #3
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can use the rectangle tool to create a shape, then press F8, then choose button (or movieclip) and give it an instance name, click ok, then you can make it transparent in the properties inspector by setting it's alpha properties to 0, then as you say add that action in the actions window with the button selected.

  4. #4
    SitePoint Member jgwebdesigner's Avatar
    Join Date
    Oct 2009
    Location
    Mechanicsburg, PA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    You can use the rectangle tool to create a shape, then press F8, then choose button (or movieclip) and give it an instance name, click ok, then you can make it transparent in the properties inspector by setting it's alpha properties to 0, then as you say add that action in the actions window with the button selected.
    Turns out it is not as simple as that, I did exactly this -- and when I select my transparent movieclip it says "Current selection cannot have actions applied to it" in the Actionscript window.. what gives? I'm confused.

  5. #5
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jgwebdesigner View Post
    Turns out it is not as simple as that, I did exactly this -- and when I select my transparent movieclip it says "Current selection cannot have actions applied to it" in the Actionscript window.. what gives? I'm confused.
    Are you sure it is a movieclip? It should be able to have actions applied to it if this is the case.

    Alternatively you can target the MC from the first frame of the movie with the following:

    Code Actionscript:
    myBut.onRelease = function() {
     getURL("#", "_blank");
    }

    myBut being the instance name you have given the MC. Also if the MC is within another timeline you can add that path to the front of that function:

    Code Actionscript:
    _root.mc1.mc2.myBut.onRelease = function() {
     getURL("#", "_blank");
    }

    So say you have the MC (myBut) in anotehr MC (mc1) within another MC (mc2) on the root timeline (_root) the above would target that.

    Hope it makes sense.

  6. #6
    SitePoint Member jgwebdesigner's Avatar
    Join Date
    Oct 2009
    Location
    Mechanicsburg, PA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is a movie clip -- turns out I wasn't selecting within the time on the timeline that it was supposed to be...... (can you tell I'm a newbie?)

    I made the movieclip (check) made it a link by adding this code within the timeline:
    var urlRequest:URLRequest =
    new URLRequest('#');
    moreEvents.addEventListener
    (MouseEvent.MOUSE_UP, gotoLinkHandler);
    function gotoLinkHandler(evt:MouseEvent):void{
    navigateToURL(urlRequest);
    }

    I found that code using an actionscript book. I understand most of the code, however now I would like to add another link on top of the same image, so I created a new movieclip and gave it a different instance, but the error console says that I have a duplicate function (which I am assuming is gotoLinkHandler), but when I try to name it something else, it does not like that. Any idea how to rectify this?

  7. #7
    SitePoint Member jgwebdesigner's Avatar
    Join Date
    Oct 2009
    Location
    Mechanicsburg, PA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured it out! With some time and frustrated patience
    Thanks for your help!


Tags for this Thread

Bookmarks

Posting Permissions

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