SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding url to flash banner

    Hi, I am new here so glad to meet you all.

    I have the following situation: I have to put a link into a flash banner with a duration of around 20 seconds. I know I have to do it through Adobe Flash, but none of the codes I have tried have worked so far, and I am stuck.

    Som of the codes I have tried are the next ones:

    hitSpot_mc.addEventListener(MouseEvent.CLICK, callLink);
    function callLink(event:MouseEvent):void {
    var url:String = "http://www.google.com";
    var request:URLRequest = new URLRequest(url);
    try {
    navigateToURL(request, '_blank');
    } catch (e:Error) {
    trace("Error occurred!");
    }
    }

    myBtn_btn.onRelease = function(){
    getURL("http://www.xxxxxx.com");
    };
    And some more I don't remember

    Any help will be more than welcome.

    Thank you all.

  2. #2
    SitePoint Member
    Join Date
    Jun 2014
    Location
    Perth, Australia
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I'm new here as well. The following should help a bit.

    You need to first check to see what version of actionscript your flash is using. You can create a flash file with actionscript 2 or 3. The first code that you have posted will work with 3 and the second will work with 2.

    You can find out which version your file was created in by opening the file and then checking the 'Script' property in the 'Properties' window of flash.

    Remove the code that is not applicable with your version of Actionscript if you have not done so already.

    You then need to make sure that your button has the same instance name as what is in your code (the first bit before the dot in both instances). See if this suggestion makes a difference in your troubleshooting and let us know what the compile error(s) are if it doesn't.

  3. #3
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,554
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    The other thing to check is that the referenced clip that you are trying to attach the click action to, persists on its own timeline for the entire duration of the movie

  4. #4
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The thing is, the whole animation is done in Flash, so I haven't really imported a movie. What I mean is that there is not a single clip on the timeline, there are several layers that run throughout the 20 seconds.

    Thanks for the inputs.

  5. #5
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,554
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    The clip with the click reference has to be on a layer that runs for the same length to the right as any other layers

  6. #6
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does run along the full duration of the clip. Still doesn't work…

  7. #7
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,554
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    If you want to post the .fla I can take a look if you want

  8. #8
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am afraid I can't, but thanks anyway.

    I still haven't fixed it…


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
  •