Professional Web Applications Themes

multiple calls to getURL("javascript:<functionN>") - Macromedia Flash Actionscript

Calling getURL with a javascript command more than once will result in one of the calls to getURL not executing. For example, create a sample movie with two frames. The first frame ActionScript is: getURL("javascript :test1();"); The second frame ActionScript is: getURL("javascript :test2();"); The Flash Movie is embedded in an HTML page as follows: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="testMovie" width="640" height="480" id="testMovie"> <param name="movie" value="testMovie.swf"> </object> In the html file with the Flash Movie above in an <OBJECT> tag, add two javascript functions: function test1() { alert("test1"); } function test2() { alert("test2"); } When the movie is run, the expected result is ...

  1. #1

    Default multiple calls to getURL("javascript:<functionN>")

    Calling getURL with a javascript command more than once will result in one of the calls to getURL not executing.

    For example, create a sample movie with two frames.

    The first frame ActionScript is:
    getURL("javascript:test1();");

    The second frame ActionScript is:
    getURL("javascript:test2();");

    The Flash Movie is embedded in an HTML page as follows:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="testMovie" width="640" height="480" id="testMovie">
    <param name="movie" value="testMovie.swf">
    </object>

    In the html file with the Flash Movie above in an <OBJECT> tag, add two javascript functions:

    function test1()
    {
    alert("test1");
    }

    function test2()
    {
    alert("test2");
    }

    When the movie is run, the expected result is to see two alert boxes, test1 and test2.
    The actual result is only one alert box, test2.

    The movie is built using Macromedia Flash MX version 6.0.
    The browser is Internet Explorer 6.0.

    Is there a way to correct this behavior so that both calls get executed?

    Many thanks,
    Michelle.


    stellaruser webforumsuser@macromedia.com Guest

  2. #2

    Default Re:multiple calls to getURL("javascript:<functionN>")

    i think your issue is timing
    if you add 50 or so frames between the getURL calls
    and close the first alert, the second one will appear,
    prolly not much help :(


    regards
    Jack..
    Jack. webforumsuser@macromedia.com Guest

  3. #3

    Default Re:multiple calls to getURL("javascript:<functionN>")

    Thanks for the suggestion! You are correct that adding a delay will make things work a little better.

    I had used setInterval with a 500 millisecond delay to make the second call to getURL("javascript:test2();");

    This resulted in both calls succeeding.

    Unfortunately, it is not a reliable method of solving the problem! It will succeed on some computers but fail on others due to the difference in processor speeds.

    Ideally, I'd like a solution to the problem that doesn't involve a 'hack'.

    At least, I'd like an explanation why it isn't working.

    Thanks,
    Michelle.


    stellaruser webforumsuser@macromedia.com Guest

Similar Threads

  1. "Page" and "Rect" props of the Field prop in Javascript API
    By ArtIn_Act@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 8
    Last Post: March 19th, 05:35 PM
  2. Replies: 0
    Last Post: September 10th, 07:45 PM
  3. Replies: 0
    Last Post: September 9th, 04:18 AM
  4. Multiple function calls on "creationComplete"??
    By WestSide in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: June 19th, 08:05 PM
  5. Client-side Javascript validation of "select multiple" for PHP
    By Phil Powell in forum PHP Development
    Replies: 3
    Last Post: October 19th, 10:04 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139