A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: How to make a clickable .swf ?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    9

    How to make a clickable .swf ?

    I have a problem. I don´t know how to make clickable .swf. I made a banner, everything works OK, but i can click on it a get to the requested page THX for help !!!

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    "can´t " of course

  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Try adding this to the main timeline
    code:

    var mouseListener = new Object();
    mouseListener.onMouseUp = function() {
    getURL("Test.html")//set to the url you want to go to.
    };
    Mouse.addListener(mouseListener);


  4. #4
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    Line 1: expecting a mouse event statement

  5. #5
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    i add it to the action script of button

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    like I said add it to the main timeline this sets the entire movie to react to the mouseUp
    NOT a button.

  7. #7
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    works, thanks - BUT - when i export it as SWF and HTML page it doesn´t work again But in Koolmoves goes ok...

  8. #8
    Steve R swrzzzz's Avatar
    Join Date
    Jan 2005
    Location
    Leicestershire,UK
    Posts
    195
    A long shot...

    How are you loading your swf into the html page?

    Are you using the ACRunActiveContent javascript?

    (I ask because if you havnt then an swf will not work unless you click once on them)

    Also you can select to allow access to the network or local files in the export settings - try changing that

    Steve

  9. #9
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Works here in browser, tested it just now in FF and IE.

  10. #10
    Steve R swrzzzz's Avatar
    Join Date
    Jan 2005
    Location
    Leicestershire,UK
    Posts
    195
    I had a problem a while back trying to open links from an swf opened in a file:// rather than from a server.

    Steve

  11. #11
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    I export it from menu in Koolmoves - on my local PC it doesn´t still work - i use IE

  12. #12
    Junior Member
    Join Date
    Aug 2006
    Posts
    9
    whole movie works on the internet www.yourdomain.com/test.swf - but exported HTMl from Koolmoves doesn´t work with it ...

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    If you are trying this locally and using IE it's most likely a security setting in IE stopping you. Try putting the HTML on a server and trying it.

  14. #14
    That web bloke Stoke Laurie's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    869
    Make a rectangle the size you want clickable, the whole banner if you wish, take off the border, and reduce the colour content down to nill to give you a transparent box. Change box to a button, and use gotoUrl from there.

  15. #15
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    http://www.bretlanius.com/flash/bannertest.html

    code used here was simply
    var mouseListener = new Object();

    mouseListener.onMouseUp = function() {

    getURL("works.html","_new")//set to the url you want to go to.

    };

    Mouse.addListener(mouseListener);

  16. #16
    That web bloke Stoke Laurie's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    869
    Thats good Brett, only thing is the curser does not change to indicate its clickable, but it would if you did it my way, no issue, plenty of ways to skin a cat - no offence pherbrick!

  17. #17
    Senior Member pherbrick's Avatar
    Join Date
    Jul 2004
    Location
    Los Angeles
    Posts
    291
    Quote Originally Posted by Stoke Laurie
    ...plenty of ways to skin a cat....
    MEOWRRR!!!

  18. #18
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Good point Stoke

  19. #19

  20. #20
    I C SERVERS Makulaf's Avatar
    Join Date
    Dec 2003
    Location
    Fredericksburg, VA
    Posts
    506
    I might be in left field here but do you have a popup blocker?
    ~~Drew~~
    New Tutorial Site Coming
    Soon
    http://board.flashkit.com/board/show....php?p=4118485

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