473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

button behaviors onpress doesnt open the movie or do anything

3
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 !
Sep 5 '08 #1
5 3162
bnashenas1984
258 100+
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
Sep 6 '08 #2
Katt
3
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
Sep 6 '08 #3
Katt
3
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 ???
Sep 6 '08 #4
bnashenas1984
258 100+
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
Sep 6 '08 #5
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.
Sep 11 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
3
by: pd | last post by:
guys, in my web app, i have a simple download button and a href which points to a file on my server, when the user clicks on the button or the link, the file should simply be downloaded to the...
1
by: geeteshss | last post by:
Dear all, actually i spent a whole month on the R&D of datagrid edit ,update,cancel events but recently my guide told me to make it user friendly because no user would like to go on searching rows...
3
by: nma | last post by:
Hi This code goes well with play, stop and fullscreen button, the only thing is the pause button is not there. How to make pause button? I try to make pause button but when it streams video, when...
12
by: Flan | last post by:
I am running on a Mac, with FlashCS3, using Actionscript 3.0. First I'm going to say that I am really new to Actionscript. (As in, only been using for a few days new.) So please excuse me if I...
1
sumaiya
by: sumaiya | last post by:
currentArticle.loadMovie(articleText); currentArticle.onPress = function() { trace("working"); } where articleText = dynamic image Now i can display the image but the onpress...
1
elamberdor
by: elamberdor | last post by:
Hi All! Have a complex roll in / roll out button (ag_mc) that unwraps, then re-wraps a chocolate upon roll in - roll out. However - to complicate things, I would also like another button ( ag_desc)...
3
by: Jeff | last post by:
I know how to use php/mysql, but the html aspect of what Im trying to do (if its even possible this way) is what Im unsure of. I want to have a button that a user can hit to valid mysql info...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.