-
Well looking at your code, the right button targets "/walking/right" not "_level0/walking/right" like the left button.
Could this be the trouble, or maybe I didn't read your problem properly... :-/
-- Leto
-
I have 3 movie clips (MC's)
The first MC instance name is "/walking" & consists of two frames
The second MC instance name is "/left" & consists of three frames
The third MC instance name is "/right" & consists of three frames
/left is inserted into frame one of /walking
/right is inserted into frame two of /walking
So the target tree looks like
/walking
+-/left
+-/right
I have two buttons bound to a left and a right keypress, which using "Tell Target" cause the appropriate MC to move forward a frame at a time with each successive keypress. When frame 3 is reached the the MC loops back to frame 1.
The code used for left button press is:
On (Key: <Left>)
Set Variable: "n" = 0
Begin Tell Target ("_level0/walking/left")
Set Variable: "n" = n + 1
Go to and Stop (n)
If (n = 3)
Set Variable: "n" = 0
End If
End Tell Target
End On
And this code works fine, and without a single problem.
But, the code used for right button press is
On (Key: <Right>)
Set Variable: "n" = 0
Begin Tell Target ("/walking/right")
Set Variable: "n" = n + 1
Go to and Stop (n)
If (n = 3)
Set Variable: "n" = 0
End If
End Tell Target
End On
But this doesn't work....and when I test the movie (alt + enter), and view the output screen i get the following error:
Target not found: Target="/walking/right" Base="_level0"
Now, the code is identical (with the exception of the keypress event) and I am totally stumped as to why I am getting the problem. Any help would be greatly appreciated. thanks for your time.
-
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Leto:
Well looking at your code, the right button targets "/walking/right" not "_level0/walking/right" like the left button.
Could this be the trouble, or maybe I didn't read your problem properly... :-/
-- Leto<HR></BLOCKQUOTE>
I just checked my code and noticed that mistake, and it doesnt matter whether the button targets begin with _level0/ or not. I still get the "Target Not Found Error"
-
Does your instance names include the "/"? That may be causing an error. If you did, Flash may not be reading your paths correctly. Try removing the "/" or adding extra "/'s" to your TellTarget paths. The "/" determines the heirarchy of your movie clip clusters. I know you probably know this, but I wanted to rule out the simple stuff first.
-
AH HA! You need your two movie instances to be present at the same frame number (can be on separate layers) of your walking movie clip. You can move left because in frame 1, you have the movie "left". The "right" clip is not even present. In fact it is in the next frame over. You cannot call a command to a movie clip that is not present (of course). Hope this is a solution.
-
Thanks for your reply, it gave me food for thought. What I eventually came up with was:
using tell target to go to the movie
then going to the specific frame
then using tell target to manipulate the MC within the specific frame
e.g.
Set Variable: "n" = 0
Begin Tell Target ("/walking") <------
Go to and Stop (2)
End Tell Target
Begin Tell Target ("/walking/walk_right") <-------
Set Variable: "n" = n + 1 <-------
Go to and Stop (n)
If (n = 3)
Set Variable: "n" = 0
End If
End Tell Target
Now, this I think is the same as what you proposed, but easier to do I think.
once again, thanks for your reply.
-
I am not used to the code/script of Flash 4. You are right, it is easier. I am just used to using Flash 3. I am trying to learn the scripting power of Flash 4. Reading you code has helped me a bit to understand what can be done. So I, in turn, thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|