A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: problem of ExternalInterface

  1. #1
    Senior Member HBB Alfred's Avatar
    Join Date
    Apr 2004
    Location
    *^_^*
    Posts
    132

    problem of ExternalInterface

    hello~
    i have tired to ExternalInterface but it doesnt work
    Code:
    // as
    myBtn.onPress = function()
    {
       flash.external.ExternalInterface.call("jsFunc", "hi");
    }
    // js
    <script language="javascript">
    function jsFunc( args )
    {
       window.alert(args);
    }
    </script>
    my flash player version is 8.0.15.0
    Last edited by HBB Alfred; 08-21-2005 at 11:17 AM.

  2. #2
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    it should be ExternalInterface.call("jsFunc","hi")
    read the help doc for more details

    for the JS part, I wonder if there is "window" before "alert"? seems there isnt....

  3. #3
    Senior Member HBB Alfred's Avatar
    Join Date
    Apr 2004
    Location
    *^_^*
    Posts
    132
    i am sorry,the code was not copy from my code
    actually, it is flash.external.ExternalInterface.call("jsFunc", "hi");

  4. #4
    Senior Member HBB Alfred's Avatar
    Join Date
    Apr 2004
    Location
    *^_^*
    Posts
    132
    Quote Originally Posted by HBB Alfred
    hello~
    i have tired to ExternalInterface but it doesnt work
    Code:
    // as
    myBtn.onPress = function()
    {
       flash.external.ExternalInterface.call("jsFunc", "hi");
    }
    // js
    <script language="javascript">
    function jsFunc( args )
    {
       window.alert(args);
    }
    </script>
    my flash player version is 8.0.15.0

  5. #5
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    hv u import the external class?

    and r u sure onPress there's reli sth happen?

    also try jus to call ExternalInterface.call("jsFunc", "hi");

  6. #6
    Member
    Join Date
    Nov 2002
    Location
    NYC
    Posts
    43
    Works for me, although it gives me a prompt saying it stopped a potentially unsafe operation. Try it without the "window" reference as mentioned.

  7. #7
    Senior Member HBB Alfred's Avatar
    Join Date
    Apr 2004
    Location
    *^_^*
    Posts
    132
    to betaruce :i don't have external class, cause of i have used flash 2004 -__-||
    but i convert swf to version 8
    to annexion :i have got the prompt of unsafe in local at first, then i have came across the script error after upload my server
    here is the test page, can you get the alert from js correctly, tell me, thank you!
    Last edited by HBB Alfred; 08-21-2005 at 09:40 PM.

  8. #8
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    Do you need to set swLiveConnect as an object/embed param for External API to work?
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  9. #9
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    no basically u don't need to set anything.

    for the unsafe part, i think all ppl will encounter this problem. we need to alter the settings of the Flahs player so that it allows the action to be called.

  10. #10
    Senior Member
    Join Date
    Nov 2000
    Location
    Manchester, UK
    Posts
    454
    Quote Originally Posted by HBB Alfred
    here is the test page, can you get the alert from js correctly, tell me, thank you!
    Hi,
    I got the alert box "aaa" without errors or warnings
    I'm viewing the sample in Firefox v 1. 0. 6
    and my flash player is WIN 8,0,5,0
    P.S.
    Wouldn't life be easy if Keyboards had a "Make It So" button?
    It could sit next to the "Any" key!!

  11. #11
    Senior Member HBB Alfred's Avatar
    Join Date
    Apr 2004
    Location
    *^_^*
    Posts
    132
    oh,thank you guys
    it's my mistake that i set the id just is a number "1" in object tag.

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