Need some HTML help

Discussion in 'Web Design and Development' started by jashsayani, Jun 10, 2009.

  1. jashsayani macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #1
    Hi,

    This is not really Mac programming but I am posting it here as there is no specific section for "Web Programming". And I love getting responses from the MacRummors community.

    Here's my question: I have an SWF object embedded in a HTML page and want to navigate to a URL when the SWF object is clicked. How do I do that ?

    Maybe use a DIV tag and embed the object inside DIV. Call a small Javascript function in the "onclick" event of DIV tag or something ??

    Pls help me out. Thanks.
     
  2. tempusfugit macrumors 65816

    Joined:
    May 21, 2009
    Location:
    Chicago
    #2
    Don't think its going to happen unless the flash object contains a link itself.
     
  3. jashsayani thread starter macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #3
    How about placing the object inside a container and adding a link to the container ?
     
  4. åidån Guest

    Joined:
    Location:
    New Zealand
    #4
    Can't you just wrap the Div in <a href=""><div><object src="swf.swf"</object></div></a>

    Something like that anyway, can't even remember if you use the object tag for that purpose :eek:
     
  5. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    You must not have looked far enough down, there's a Web Design & Development forum here. I've asked mods to move this there.

    As to your question, within the Flash you can do,
    PHP:
    on (release) { 
    getURL ("http://www.mofunzone.com/","_self"); 
    }
     
  6. ayale99 macrumors 6502

    Joined:
    Dec 6, 2007
    #6
    That'll work IF the OP has the original .fla file to open up. Sounds like he may only have a .swf though.

    I know it's an ugly way to do it, but how about an image map area over the top of the swf?
     
  7. a cat *miaow* macrumors regular

    Joined:
    Jun 12, 2007
    #7
    Either you need the link in the flash like stated above. Or you should use clicktag (if you're going to change the URL it's the better route as you don't have to edit the Flash each time you change the link destination).

    There's a tutorial here:
    http://www.adobe.com/resources/richmedia/tracking/designers_guide/

    Or if you search for clickTAG you'll find lots of help.
    This is the method advertising networks use to track link referrals.
     
  8. savar macrumors 68000

    savar

    Joined:
    Jun 6, 2003
    Location:
    District of Columbia
    #8
    That wouldn't be valid. "a" is an in-line element, and "div" is block. You can't put a block inside an in-line.

    One wicked idea -- in other words, "don't try this at home kids" -- would be to put an invisible div directly on top of the flash chart and set the onclick handler for that.

    I did this one time to do the reverse: prevent users from clicking on the flash chart.

    You would have to set the position to absolute (assuming that the invisible div and object both have the parent element) and then set the z-index to a large number.
     
  9. jashsayani thread starter macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #9
    Well, I had made the banner for a client and he wanted a link, after a few days of completion. So, I was looking for a solution. But nothing worked, so I updated the FLA file with the AS code.
     

Share This Page