A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Flash to JavaScript and back

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    Flash to JavaScript and back

    Hi
    Is it posible to to execute a Javascript function inside a Flash movie, and have that Javascript function to execute a function inside Flash.

    eg.


    1. Flash:
    Text with a link eg. <a href="JavaScript: doSomething(1,2,3)">

    2. JavaScript:
    function doSomething(one,two,three) {
    executeFlashFunction(one, two, three)
    }

    3.
    Flash again: executeFlashFunction(one, two, three) {
    go ...
    }


    What I need is to execute a function inside Flash from dynamically loaded text.

    Hope anyone have some tips or suggestions.

    best regards,
    T

  2. #2
    Italy Novik2000's Avatar
    Join Date
    Jun 2001
    Posts
    360
    to call javascript function from Flash movie you can use:
    1. FSCommands - check it.
    2. getURL("javascript:yourFunction();");

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You can use the Flash methods to communicate from one to the other and back, but you can't really directly call a function located in the Flash movie from javascript... You would have to either condition the execution of the Flash function based on a variable passed from the javascript (setVariable), or send the Flash movie to some particular frame (TGotoFrame), where the actual function would be called within Flash...

    http://www.macromedia.com/support/fl...hflash_03.html

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