Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 5th, 2008, 10:34 PM
Newbie
 
Join Date: Sep 2008
Posts: 3
Default button behaviors onpress doesnt open the movie or do anything

first of all I am new to flash.
I just started to use CS3, and I have 2.0 actionscript selected

Cannot get my MC button instance to go play a movie clip on another frame,

I have tried both behavior and frame gotoandplay script, stop etc.
current button behavior setting:

on (press, release, dragOut) {

//Movieclip GotoAndPlay Behavior
this.directions.gotoAndPlay("1");
//End Behavior

}

could be where the movie clip is in the timeline ? ????? not getting any errors just isn't working !
Reply
  #2  
Old September 6th, 2008, 02:01 AM
Familiar Sight
 
Join Date: Sep 2007
Posts: 194
Default

I use AS3 but i might be able to answer your question.

You may know about naming frames. You can have lable for each frame you like. for example :
We have a movie with 20 frames and when we click on a Movie Clip on the first frame then it goes to the 10th frame and stops : gotoAndStop(10)
but what happens if we add 5 frames between frame 0 and 10?
Then the 10th frame will be moved to 15 and the script will not work as we wish because it still goes to 10th frame and stops which is a wrong number. (should be 15)
So thats why sometimes we need to name frames (Label) for NOT getting confused

Here is what you are doing wrong. when we want to send the movie to a specified lable then we put the frame's name (label) on qouts like this : gotoAndStop("FrameName")

But when we want to do the same thing by using frame's number then we don't use quets like this : gotoAndStop(1)


hope this helps you

Good luck
Reply
  #3  
Old September 6th, 2008, 03:39 AM
Newbie
 
Join Date: Sep 2008
Posts: 3
Default

Quote:
Originally Posted by bnashenas1984
I use AS3 but i might be able to answer your question.

You may know about naming frames. You can have lable for each frame you like. for example :
We have a movie with 20 frames and when we click on a Movie Clip on the first frame then it goes to the 10th frame and stops : gotoAndStop(10)
but what happens if we add 5 frames between frame 0 and 10?
Then the 10th frame will be moved to 15 and the script will not work as we wish because it still goes to 10th frame and stops which is a wrong number. (should be 15)
So thats why sometimes we need to name frames (Label) for NOT getting confused

Here is what you are doing wrong. when we want to send the movie to a specified lable then we put the frame's name (label) on qouts like this : gotoAndStop("FrameName")

But when we want to do the same thing by using frame's number then we don't use quets like this : gotoAndStop(1)


hope this helps you

Good luck

Thanks for the help, I am going to try this but I saved a second copy and am trying actionscript 3.0 here is my code

stop();

import flash.events.MouseEvent;

//---find us property change---\\\

findus_btn.addEventListener(MouseEvent.CLICK,rClic k);

function rClick(event:MouseEvent):void{
gotoAndStop("directions");
}


and am getting this error,
1046: Type was not found or was not a compile-time constant: home.

any ideas !

I will got back to the 2.0 version and try your suggestion now------

still no go: does this look right ?

on (release) {
gotoAndStop("directions");
}

does the frame have to be on the same layer?
Thanks
Reply
  #4  
Old September 6th, 2008, 06:15 AM
Newbie
 
Join Date: Sep 2008
Posts: 3
Default

Quote:
Originally Posted by Katt
Thanks for the help, I am going to try this but I saved a second copy and am trying actionscript 3.0 here is my code

stop();

import flash.events.MouseEvent;

//---find us property change---\\\

findus_btn.addEventListener(MouseEvent.CLICK,rClic k);

function rClick(event:MouseEvent):void{
gotoAndStop("directions");
}


and am getting this error,
1046: Type was not found or was not a compile-time constant: home.

any ideas !

I will got back to the 2.0 version and try your suggestion now------

still no go: does this look right ?

on (release) {
gotoAndStop("directions");
}

does the frame have to be on the same layer?
Thanks

Hey,

Think I figured out 3.0 a little bit, I am going to keep playing with it ,

Thanks

My code was ok, had a layer screwing it up or something ???
Reply
  #5  
Old September 6th, 2008, 12:43 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 194
Default

Hi Katt
I didn't see anything wrong in your script. It might be something wrong with MovieClips or timeline.

Make sure you have both your script and movie clip on the same frame and that you have named your frame correctly.

And note that Action Script is case sensetive. For example (my_MC) is not the same as (my_mc)

Post back if you need more help

Good luck
Reply
  #6  
Old September 11th, 2008, 09:09 AM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

Expand|Select|Wrap|Line Numbers
  1. on(release){
  2.   gotoAndStop('Directions');
  3. }
Your code is fine, it's probably in the wrong location.

Make sure that your code is for your button symbol and not the frame instance. What I mean is when you select a frame in your timeline or a layer where your button is located, it doesn't mean you have selected the button, even though it seems like it has been selected already. Make sure you select that button from 'the stage' and then type in your script.

You'll notice that the Actions tab will read Actions-Frame when you select a frame and Actions-Button when you select a button from the stage.

Hope this helps.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles