A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Help me! Flash Button to run JavaScript

  1. #1
    Junior Member
    Join Date
    Feb 2004
    Location
    Pakistan
    Posts
    4

    Help me! Flash Button to run JavaScript

    Help me! I want to run JavaScript by Click on Flash Push Button
    Asim Hameed

  2. #2
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    Code the function into the head of the html and then use the following code to execute it:

    Code:
    on(release){
      getURL("yourfunction();");
    }
    XFM

  3. #3
    Member
    Join Date
    Aug 2001
    Posts
    32
    When you do it like that and click the button you hear a "click sound" which is ok if you are launching a popup window.

    However, I have a java applet that views panorama virtual tours.
    Under it I have buttons to move left,right,zoom in & out and everytime I hit a flash button you get the "browser click sound"

    If I make the rollover image feature in dreamweaver for the control buttons the beginning of the code looks like this:

    <a href="#" onMouseOut="MM_swapImgRestore()"
    If I remove the href="#", then the rollover button works but it doesn't generate the "click sound", which is what I also want to achieve with a flash button.

    I hope this makes sense but I want several buttons in flash to call a function and not generate the "click sound". Possible?

    Thanks,
    George

  4. #4
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    Sorry, but I think it's an internet explorer thing, so coding something in flash wouldn't do anything.

    I duno if there is and javascript that disables the sound...

    XFM

  5. #5
    Member
    Join Date
    Aug 2001
    Posts
    32
    Is there another way to call a function without using "get url"?

    -GB

  6. #6
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    Not that I know of matey

    XFM

  7. #7
    Senior Member
    Join Date
    Aug 2009
    Posts
    113
    how bout the other way around?

    running flash button with javascript??

  8. #8
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    There is a way to do it, I'm just not familiar with it. I worked with JS and Flash recently on a third party image resizer.

    Go to http://www.resize-before-upload.com and check their demos area. They have a demo that has a form that executes a flash function.

    XFM

  9. #9
    Senior Member
    Join Date
    Aug 2009
    Posts
    113
    ok ill try but i think it is a little complicated eheh

  10. #10
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    If you dont want the sound to come then you have to call the JavaScript function using fsommand();

    To know more about fscommand, look at this tutorial.
    As ever,
    Vinayak Kadam

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