SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru augathra's Avatar
    Join Date
    Jul 2004
    Location
    united states
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onclick on flash not working

    Hey, i'm not sure if this is a JS error or not, but here's my problem.

    I'm trying to run a function when a user onclicks a flash ad.
    <object onclick="JSFunction(<?PHP echo $id; ?>)" classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">
    <param name="movie" value="movie.swf">
    <param name="quality" value="high">
    <embed src="movie.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1024" height="768"></embed>
    </object>

    The function is
    var url = "http://www.example.com/" + notherVar
    window.open(url, WindowName);

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    UK, London
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Flash is an own object, and cannot be linked, as it has its own mouse functionality. If you want to link a flash movie, link it in the Flash, as in ActionScript.
    Chris Heilmann
    Blog | Articles | Binaries

  3. #3
    SitePoint Guru augathra's Avatar
    Join Date
    Jul 2004
    Location
    united states
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply. I really haven't worked with flash (other than swish). Do you know if I could use swish to add a "parameter" to the flash file via the PHP page?
    I need to use the id # of the flash file in the click.

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by codepoet
    Flash is an own object, and cannot be linked, as it has its own mouse functionality. If you want to link a flash movie, link it in the Flash, as in ActionScript.
    Actually, there is a way to link it with JavaScript. A solution was posted here before, but it seemed not worth the hassle.

  5. #5
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    UK, London
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you could add an onclick handler to the object, but I doubt it will work cross platform/browser. And that is not linking, it is adding a behaviour :-)

    The whole idea of Flash is that it is an own layer, with lots of interactivity that is not possible in HTML. Bit of a waste to see it as a smoother animated GIF.
    Chris Heilmann
    Blog | Articles | Binaries

  6. #6
    SitePoint Guru augathra's Avatar
    Join Date
    Jul 2004
    Location
    united states
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to create flash video w/o a direct link on it, yet still clickable?

    My plan is to create a DB table with all the flash videos in them and rotate them (there are other methods, but I'm using the DB for statistical reasons). Since I'm going to need to know statistics, I will need a row ID #, which I can't get until the movie is in the DB.

    That's why I had my last code with the JS function & the row['id'] #. The function goes to somepage.php?id=6
    then the DB selects row 6, fetches the URL, and forwards to it. As I said, I don't know much about flash - anyone know a tutorial or something that would allow me to do this?


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
  •