<embed> how to make it clickable

Discussion in 'HTML & Website Design' started by PinoyIto, Jul 7, 2008.

  1. #1
    I want my swf file as anchor link but seems not working...

    I use the following code to do the job but won't work

    
    <a href="targeturl"><embed width='170' height='120' src='http://myurls.com/ads/Movie4.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' ></embed> </a>
    
    Code (markup):
    The embeded file is showing but it's not clickable, seems the a href not working with it.
     
    PinoyIto, Jul 7, 2008 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    Try
    
    <embed 
        onclick="document.location.href='http://google.com'" 
        width='170' 
        height='120' 
        src='http://myurls.com/ads/Movie4.swf' 
        quality='high' 
        pluginspage='http://www.macromedia.com/go/getflashplayer' 
        type='application/x-shockwave-flash' >
    </embed>
    Code (markup):
    I'd highly recommend against Flash ads though.
     
    blueparukia, Jul 7, 2008 IP
  3. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #3
    Thanks mate but still the code don't work...
     
    PinoyIto, Jul 8, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Embed, gag. Okay, it's Flash, so here's what you do:

    open the fla (don't have it? Can't make it a link then, sorry, outta luck)
    Make a new layer and call it something like "button" <-- make sure it's the TOP LAYER
    put a fill-box there, aligned to all the sides of the stage. So, a box without a border, fill-only, no stroke, and covers the other frames below it
    make it a Symbol, type=button
    go inside the symbol
    up by the Frames on top, move the selected dot over to Hit (makes this button invisible and everywhere where that fill-box is, will be clickable)
    get out of the symbol and check that there's an aqua colour over your Flash (means there's a button there on top)... Test Movie should give you a hand cursor
    Go to Actions window and make sure you are in the button, not Frame. This means this fla had better been made with Actionscript 2.0 and not 3!!!
    The properties panel on the bottom should also say "Button" on the left side. So now you can type your URL codes:
    in Actions panel/window:
    on (release) {
    getURL("http://www.example.com");
    }

    Make sure the little eye up in the Frames is crossed out and you won't see the button anymore. If you Test Movie you should be able to click on it. I haven't gotten this to work with Actionscript3 so maybe it's possible, but I use Actionscript 2 instead.

    Nothing wrong with Flash banners but make sure they are as small as possible. It's really easy to get huge file sizes, esp if you have imported raster images (jpg's, gif's, etc)
     
    Stomme poes, Jul 8, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Oh....a long time since I've used actionscript, but I believe there is a way to do it:

    
    var site = "http://google.com";
    var httpRequest:URLRequest = new URLRequest(site,'_self');
    
    on(release){
      navigateToURL(httpRequest);
    }
    
    Code (markup):
    You may want to try putting it in a try...catch statement (is that the word) because knowing my Actionscript abilities, at least one thing is wrong with that code.

    EDIT: Fixed 3 bugs
     
    blueparukia, Jul 8, 2008 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    But where does he set that variable? He still needs the fla right? Or can that Actionscript be reached via JS on the page? (that would be easier, as the same banner can have its URL set by the site owner without them needing the Fla)
     
    Stomme poes, Jul 8, 2008 IP
  7. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #7
    He still needs the Fla, I was actually responding to you, since that should work in AS3
     
    blueparukia, Jul 8, 2008 IP
  8. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #8
    so no chance to used this flash file as clickable :( because I don't have the fla file... thanks for the input guys
     
    PinoyIto, Jul 8, 2008 IP