Professional Web Applications Themes

sequential javascript commands in actionscript - Macromedia Flash

Hi, I am trying to make DIV layers disappear on a frame of a movie no matter how many were opened. So I have a "Forward" into which I have added the javascript on (release) { currentStep = bringmenu.PreviousStep(currentStep); getURL ("javascript :hideDiv2('dcCon02')"); getURL ("javascript :hideDiv1('dcCon01')"); } The problem is only the second getURL command is executed. If I swap them around, it's the same thing. Only the second getURL works. Is there some way I can combine these or find another work around? I've tried getURL ("javascript :hideDiv2('dcCon02')") ("javascript :hideDiv1('dcCon01')"); (all one line) But no luck. Thanks, Nigel...

  1. #1

    Default sequential javascript commands in actionscript

    Hi,

    I am trying to make DIV layers disappear on a frame of a movie no
    matter how many were opened. So I have a "Forward" into which I have
    added the javascript

    on (release) {
    currentStep = bringmenu.PreviousStep(currentStep);
    getURL ("javascript:hideDiv2('dcCon02')");
    getURL ("javascript:hideDiv1('dcCon01')");
    }

    The problem is only the second getURL command is executed. If I swap
    them around, it's the same thing. Only the second getURL works. Is
    there some way I can combine these or find another work around?

    I've tried

    getURL ("javascript:hideDiv2('dcCon02')")
    ("javascript:hideDiv1('dcCon01')");

    (all one line)

    But no luck.

    Thanks,

    Nigel
    Nigel Guest

  2. #2

    Default Re: sequential javascript commands in actionscript

    Nigel wrote:
    > I've tried
    >
    > getURL ("javascript:hideDiv2('dcCon02')")
    > ("javascript:hideDiv1('dcCon01')");
    >
    > (all one line)
    You might try:
    getURL ("javascript:hideDiv2('dcCon02');hideDiv1('dcCon01 ')");

    Not sure that will work, but it may be worth a try.


    --
    Brandon Bradley
    Macromedia Certified Instructor
    [url]http://www.attconline.org/[/url]
    Brandon Bradley Guest

  3. #3

    Default Re: sequential javascript commands in actionscript

    On 2005-04-02 11:01:58 -0800, Nigel <not_realaddress.com> said:
    > Hi,
    >
    > I am trying to make DIV layers disappear on a frame of a movie no
    > matter how many were opened. So I have a "Forward" into which I have
    > added the javascript
    >
    > on (release) {
    > currentStep = bringmenu.PreviousStep(currentStep); getURL
    > ("javascript:hideDiv2('dcCon02')");
    > getURL ("javascript:hideDiv1('dcCon01')");
    > }
    >
    > The problem is only the second getURL command is executed. If I swap
    > them around, it's the same thing. Only the second getURL works. Is
    > there some way I can combine these or find another work around?
    >
    > I've tried
    >
    > getURL ("javascript:hideDiv2('dcCon02')")
    > ("javascript:hideDiv1('dcCon01')");
    >
    > (all one line)
    >
    > But no luck.
    >
    > Thanks,
    >
    > Nigel
    It'd be better to make a more flexible Javascript function that can
    accept paramters from you to tell it which DIV to hide/unhide etc..
    then you only have to make 1 JS call at a time. However, if you must
    make multiple different calls like this - I would recommend using
    setInterval or soem other way of offsetting the calls by at least
    300ms. That seems to fix the issue every time.
    --
    The Grass Apple - { [url]www.grassapple.com[/url] } news?

    timberfish Guest

  4. #4

    Default Re: sequential javascript commands in actionscript

    I've had similar problems, it seemed to me that it was not multiple
    javascript that caused the problems, just the first javascript was not
    executed. My messy work around was to have a javascript command right at the
    start of the code, which didn't work, then the rest appeared to do so.
    I thought that maybe javascript somehow wasn't started up and it took one
    command to start it. I was experiencing this when running just the swf in
    IE. I didn't try any other browsers or an embedded swf.

    -JP


    JP Guest

Similar Threads

  1. Calling ActionScript methods from javascript?
    By dforer in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 19th, 12:23 AM
  2. sequential functions?
    By originalknappster webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 5th, 09:17 PM
  3. Help! actionscript-javascript
    By Bootstrap Bill in forum Macromedia Flash
    Replies: 2
    Last Post: September 24th, 05:42 PM
  4. Adding actionscript commands to a buttons?
    By Thundercat webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 2
    Last Post: September 20th, 08:30 AM
  5. How to add a sequential number to a form
    By Michael Budash in forum PERL Miscellaneous
    Replies: 1
    Last Post: July 11th, 12:47 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