A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Javascript Integration Kit question

  1. #1
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875

    Javascript Integration Kit question

    Hi guys..im tryign to make a call from javascript to an actionscript function using the javascript and flash integration kit. The flash file is called index.swf. And the code in the holding page is as follows:

    Code:
    <html>
    <head>
    <script type="text/javascript" src="JavaScriptFlashGateway.js"></script>
    <script type="text/javascript">
    	var uid = new Date().getTime();
    	var flashProxy = new FlashProxy(uid, "JavaScriptFlashGateway.swf");
    </script>
    </head>
    <body bgcolor="#ffffff">
    <script type="text/javascript">
        var tag = new FlashTag("index.swf", 550, 400); // last two arguments are height and width
        tag.setFlashvars("lcId="+uid);
        tag.write(document);
        flashProxy.call("showAlert", "my string");
    </script>
    </body>
    </html>
    In my flash file index.swf I have a function

    Code:
    function showAlert(){
    	tName.text = "hello";
    }
    All the files index.swf,index.html,JavaScriptFlashGateway.swf, and JavaScriptFlashGateway.js are in the same directory...

    however the flash function does not seem to get called... has anyone got any tips or ideas why?

    Thanks in advance

    Note: the javascript integration kit can be downloaded from http://weblogs.macromedia.com/flashjavascript/ ..all the documentation is contained within the package..
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    bump..
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    pardon my ignorance but what's the difference between the integration kit and external interface?

    Is there a chance you are using flashProxy.call() before the .swf is loaded?

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    sorry should have mentioned..im using mx 2004 not flash 8..as far as im aware the external interface class is available for only for flash 8 onwards ..

    Is there a chance you are using flashProxy.call() before the .swf is loaded?
    Thats what i thought intially so i created a button on the page(so i could call the function after the swf has loaded)

    <img src="hello.jpg" onclick="javascript:flashProxy.call('showAlert', 'my string');" />

    however this still does not work!!
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    hmm, this page shows more includes and a little different usage.
    http://osflash.org/flashjs/docs/usage/astojs

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