17 Replies Latest reply on Mar 6, 2007 7:33 PM by Sketchsta

    Flash WOUN'T let me use timeline actionscript

    Sketchsta Level 1
      This couldnt have come at a worst time, i have m deadline in 2 days, and i have barely started the work... and now, Flash will not let me use actionscript on frames to target anything anymore....

      I first noticed it when i was making the navigation bar, it simply would NOT target any of the buttons i told it to... I tried making new FLA's I even tried adding trace for RollOver RollOut Release Press etc... Nothing worked....

      I have no idea what could have happened, except that, I was helping someone here, who ironically had the problem im having now... Who would his problem get transfered to my Flash??
      I did open a FLA from him though, that might have been it... but I checked and re-checked the Preferences, and everything sems fine...

      Anyone have any Ideas at all??
      I really need to get this fixed...

      Thanx in advance...
        • 1. Re: Flash WOUN'T let me use timeline actionscript
          Level 7
          Sketchsta,

          > This couldnt have come at a worst time, i have m deadline in
          > 2 days, and i have barely started the work...

          Heh, I've been there. Chin up.

          > and now, Flash will not let me use actionscript on frames to
          > target anything anymore....

          Okay.

          > I first noticed it when i was making the navigation bar, it simply
          > would NOT target any of the buttons i told it to... I tried making
          > new FLA's I even tried adding trace for RollOver RollOut Release
          > Press etc... Nothing worked....

          Best thing to do would probably be to show some of your code.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Flash WOUN'T let me use timeline actionscript
            dr_ross Level 1
            Best to upload it, could be any number of things like, is the code thats targeting the button on the root timeline or on the button itself, and if on the root is that the code frame still around when the button is created.

            Easily fixed with a fresh pair of eyes on it.
            • 3. Re: Flash WOUN'T let me use timeline actionscript
              Sketchsta Level 1
              i dont want to upload it, because i think i got this problem From opening a FLA that originally had it... so if i upload it, and you open it, your Flash might not work right either...

              im just trying verry basic things now... and still nothing..

              i made a MovieClip on _root.. (clip_mc)
              inside i have 3 layers, one for AS, one to act like the HIT for a button, and last, i have animated text, with frameLabels ( over, out)

              if i put the code on _root timeline... nothing...

              clip_mc.btn.onRollOver = function(){clip_mc.gotoAndPlay("over")}

              if I put th code on a frame inside clip_mc... nothing..

              btn.onRollOver = function(){gotoAndPlay(:over")}

              no matter where I put the code... I cant target anything... I have no idea what could be causing this... I've just Reset Defaults in all my Preferences, and still nothing...
              • 4. Re: Flash WOUN'T let me use timeline actionscript
                Sketchsta Level 1
                if i use code on the button itself, then it works just fine...
                im trying to figure out why i cant target anything from code in a frame...

                I cant even call a function... i placed traces all over the FLA, and none of them work...
                • 5. Re: Flash WOUN'T let me use timeline actionscript
                  Sketchsta Level 1
                  David???

                  How did you get there on top??
                  I didnt see your post before?
                  Hows it going!!

                  well...
                  VERRRY basic stuff im trying now, just to see what works and what doesnt..

                  basicaly last thing i did, was, made a MovieClip on _root, called clip_mc

                  inside here, i have e layers ( just making a button ) first layer for action script.. second i have a rectangle to act as the hit stage for the animation... and third, some animated text..

                  frame labels ( over, out )

                  basically, no matter where i put the code ( on frame ) id will NOT target the button...
                  I can place the code n the button itself, that works... but i want to know why i cant use frame code anymore.. what happen??

                  I've quadruple checked each target path, just to make sure im getting it right... i even used the Select Target tool from actions pannel... and still nothing..
                  • 6. Re: Flash WOUN'T let me use timeline actionscript
                    Level 7
                    Sketchsta,

                    > I didnt see your post before?
                    > Hows it going!!

                    It's going good. :) I usually post with a news client, and there's a
                    difference in timing between web-interface and news client-interface posts.

                    > basicaly last thing i did, was, made a MovieClip on
                    > _root, called clip_mc

                    Okay.

                    > inside here, i have e layers ( just making a button )
                    > first layer for action script.. second i have a rectangle
                    > to act as the hit stage for the animation... and third,
                    > some animated text..

                    I'm with ya.

                    > basically, no matter where i put the code ( on frame ) id
                    > will NOT target the button...

                    Does the button have an instance name? You didn't mention instance
                    names in your first post, so I'm wondering if that's it.

                    > I've quadruple checked each target path, just to make sure
                    > im getting it right... i even used the Select Target tool from
                    > actions pannel... and still nothing..

                    Well, that sounds like you do have a instance name. Let's see your code
                    itself, then. :)


                    David Stiller
                    Adobe Community Expert
                    Dev blog, http://www.quip.net/blog/
                    "Luck is the residue of good design."


                    • 7. Re: Flash WOUN'T let me use timeline actionscript
                      Sketchsta Level 1
                      ok, just an update that i just found out...

                      I tried to target the MovieClip (clip_mc) located on _root timeline, from code in the first frame...
                      I targeted it by..

                      clip_mc.onRelease = function(){
                      trace("clip_mc pressed");
                      }

                      and it worked... so I can target that movieClip, but cant target anything inside it..

                      Then i tried placing clip_mc inside another movieClip ( hold_this ) then i tried to target it again...

                      hold_this.clip_mc.onRelease = function(){
                      trace("clip_mc pressed");
                      }

                      It wouldnt work..

                      so im thinking that the problem lies somewhere in targeting child objects...
                      • 8. Flash WOUN'T let me use timeline actionscript
                        Sketchsta Level 1
                        yeah sorry, i DID forget to mention that.. oops!!!

                        the button name is

                        btn
                        ________________________________________________
                        this is before the hold_this movieClip..


                        if i put the code on _root timeline... nothing...
                        clip_mc.btn.onRollOver = function(){clip_mc.gotoAndPlay("over")}

                        if I put th code on a frame inside clip_mc... nothing..
                        btn.onRollOver = function(){gotoAndPlay("over")}
                        • 9. Re: Flash WOUN'T let me use timeline actionscript
                          Level 7
                          Sketchsta,

                          > I tried to target the MovieClip (clip_mc) [...]
                          > clip_mc.onRelease = function(){
                          > trace("clip_mc pressed");
                          > }
                          >
                          > and it worked...

                          Cool. Good so far.

                          > Then i tried placing clip_mc inside another movieClip
                          > ( hold_this ) then i tried to target it again...
                          > hold_this.clip_mc.onRelease = function(){
                          > trace("clip_mc pressed");
                          > }
                          > It wouldnt work..

                          Okay, so something is going on here, and this is the spot (or one of the
                          spots).

                          Does hold_this have any mouse-related event handlers of its own? If so,
                          those would "drown out" the mouse-related event handlers of its children.


                          David Stiller
                          Adobe Community Expert
                          Dev blog, http://www.quip.net/blog/
                          "Luck is the residue of good design."


                          • 10. Flash WOUN'T let me use timeline actionscript
                            Sketchsta Level 1
                            No, hold_this was placed on stage for the sole purpose of seeing if i can still target clip_mc when it became a child.

                            it couldn't be targeted, as you know.

                            I tried ( out of sheer frustration ) to go all the way and target the button again from _root..

                            hold_this.clip_mc.btn.onRollOver = function(){
                            hold_this.clip_mc.gotoAndPlay("over");
                            trace("hold_this.clip_mc.btn pressed");
                            }

                            that didnt work.. I'm out of ideas right now..

                            The only explanation for getting this problem, is opening the FLA from a guy I was helping... he was having the same problem, couldnt target child objects..

                            but he was using a different method to make buttons..
                            You're method actually... you told me about naming frames _up, _over, _down.
                            thats what he was using.
                            • 11. Re: Flash WOUN'T let me use timeline actionscript
                              Level 7
                              Sketchsta,

                              > I tried ( out of sheer frustration ) to go all the way and
                              > target the button again from _root..
                              >
                              > hold_this.clip_mc.btn.onRollOver = function(){
                              > gotoAndPlay("over");
                              > trace("hold_this.clip_mc.btn pressed");
                              > }

                              Actually, I don't see any _root reference there. But the above code
                              should do just fine, as long as the ActionScript was place in a location
                              that could "see" the hold_this clip from where it was.

                              > that didnt work.. I'm out of ideas right now..

                              I suspect this is something pretty simple that neither of us sees (yet).
                              Devil is in the details.

                              > The only explanation for getting this problem, is opening the
                              > FLA from a guy I was helping... he was having the same
                              > problem, couldnt target child objects..

                              Nah, that really shouldn't have anything to do with it. I don't often
                              have time to look at actual FLAs, but go ahead and send me this one, if you
                              like. Maybe something will jump out at me. Send to my last name (at) quip
                              (dot) net


                              David Stiller
                              Adobe Community Expert
                              Dev blog, http://www.quip.net/blog/
                              "Luck is the residue of good design."


                              • 12. Re: Flash WOUN'T let me use timeline actionscript
                                Sketchsta Level 1
                                >Actually, I don't see any _root reference there. But the above code
                                >should do just fine, as long as the ActionScript was place in a location
                                >that could "see" the hold_this clip from where it was.

                                Yeah, the code was from the first frame on _root timeline :)

                                yes... simple, i think its somesettingsthat have been changed in config/options or preferences, or somewhere..
                                I've had a look through it all, but i cant find anything that's out of place.. I even reset Defaults to the Preferences, n still nothing..

                                Well if anything jumps out, you would surely notice it faster than me, thats for sure..
                                .................
                                this is just really strange, i cant think of a single thing that would make Flash act up like this...
                                I mean, i know i can get around it, by adding the code to the symbols themselves... but I Love Flash... I dont like to know that she's sick, and i cant help :)
                                • 13. Re: Flash WOUN'T let me use timeline actionscript
                                  Level 7
                                  [ Responding to the email received from Sketchsta ]

                                  Sketchsta,

                                  I see a couple things wrong with your file, so I'll steer you in what I
                                  hope is a helpful direction.

                                  The trick I mentioned in another post, about providing underscore frame
                                  labels (e.g., _over) is a mechanism that works on its own. In other words,
                                  this line here ...

                                  mon_clip_mc.onRollOver = function() {
                                  mon_clip_mc.gotoAndPlay("_over");
                                  };

                                  ... isn't necessary, because "_over" has a special meaning when used as a
                                  frame label. Commont out this event handler, and you'll see!

                                  But let's say you were using a different frame label -- something
                                  custom. If that were the case, you would want to use gotoAndStop(), rather
                                  than gotoAndPlay() in this particular onRollOver handler. As it is now,
                                  you're telling mon_clip_mc to go to he _over frame and *play,* which makes
                                  it whiz right past the frames that show your revealed sub-menu.

                                  Makes sense, right?

                                  The other thing is this: once that sub-menu drops, it's only *then*
                                  that your sous-menus appear. They aren't present -- don't exist yet -- from
                                  fhe point of view of this line in the _root ...

                                  mon_clip_mc.smenu1_mc.onRelease = function() {
                                  _root.gotoAndPlay(20);
                                  };

                                  ... because they haven't yet appeared in mon_clip_mc's timeline. What you
                                  may want to do in this situation is move everything up to frame 1 inside
                                  mon_clip_mc's timeline and use ActionScript to turn the MovieClip._visible
                                  property of the sub-menus to false. Or leave them where they are in that
                                  timeline, but give them an Alpha setting of zero until they hit the "_over"
                                  frame. But whatever you do, you need to make a direct line between them and
                                  the ActionScript that tells them what to do.


                                  David Stiller
                                  Adobe Community Expert
                                  Dev blog, http://www.quip.net/blog/
                                  "Luck is the residue of good design."


                                  • 14. Re: Flash WOUN'T let me use timeline actionscript
                                    Sketchsta Level 1
                                    Thanx David.

                                    So how's your Flash doing? everything alrite?
                                    • 15. Re: Flash WOUN'T let me use timeline actionscript
                                      Level 7
                                      Sketchsta,

                                      > Thanx David.
                                      >
                                      > So how's your Flash doing? everything alrite?

                                      Life is good, thanks! :)



                                      • 16. Re: Flash WOUN'T let me use timeline actionscript
                                        Level 7
                                        >> So how's your Flash doing? everything alrite?
                                        >
                                        > Life is good, thanks! :)

                                        By which I mean, no damage.


                                        • 17. Re: Flash WOUN'T let me use timeline actionscript
                                          Sketchsta Level 1
                                          hmm... there must be something else that caused my flash to miss-behave..

                                          i'll try some more on this issue after tomorrow, the " im dead " deadline..

                                          If you have any other ideas of what might cause such things, let me know please.. like i said, i still want to know what happened in the first place to make Flash act strange..