Skip navigation
dmiddletonla
Currently Being Moderated

Cant get my ad banner into a clickable link

Apr 29, 2013 7:49 PM

Hi all - hoping someone can help me.

 

I have created a simple ad banner in Flash CS5. I am trying to make it so that when I u/l the .swf to my site, the banner will be a clickable link that will take me to the desired place. I have found some tutorials on yt - one in particular was very good. I followed it to the tee, but it still does not work. The banner exports just fine, but there is no URL associated with it. I am using AS 3.0 and this is the code I have:


import flash.events.MouseEvent;
import flash.net.URLRequest;

circle.addEventListener(MouseEvent.CLICK,pressed);

function pressed(e:MouseEvent):void
{

 var url:String = "[http://www.umysite.com | http://www.umysite.com]"
 var request:URLRequest = new URLRequest(url);
 navigateToURL(request,'_blank');
}

 

Can someone please tell me what I am missing here? Thank you!

 

 

 

 

 
Replies
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 29, 2013 10:08 PM   in reply to dmiddletonla

    that url string is not a url.  use something like:

     

    var url:String = "http://www.umysite.com"

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 30, 2013 10:01 AM   in reply to dmiddletonla

    then that will work if circle is pressed, you have no popup blocker, no security sandbox issue and you use a valid url.

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 30, 2013 11:32 AM   in reply to dmiddletonla

    what's the link you're using to test your banner?

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 30, 2013 1:34 PM   in reply to dmiddletonla

    using as2 won't make any difference.

     

    can you confirm circle is dispatching the click event and pressed() is being called?

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 30, 2013 4:24 PM   in reply to dmiddletonla

    you probably have a sandbox security issue.  test on a (non-local) server.

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    May 2, 2013 9:22 AM   in reply to dmiddletonla

    make sure whatever object has your click listener exists throught the main timeline.

     

    if there's more than 1 keyframe in the layer that contains that object, you may be replacing that object and not realize it because of the way your fla was created.

     

    so, make sure there's only 1 keyframe (likely frame 1) in the layer that contains the object with your click listener.

     

    kg

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points