Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 04-24-2002, 02:59 AM   #1
nubian
Member
 
Join Date: Apr 2002
Posts: 75
Send a message via AIM to nubian
Angry trying to jump to a different scene from a button inside a movie-clip

I'm trying to jump to a different scene from a button inside a movie-clip

does anyone know how this can be done. i know it something stupid i'm overlooking.

please check out the my swf example i made especially for this:

http://www.radermotorsport.com/scenetest.swf

also fla can be found here:

http://www.radermotorsport.com/scenetest.fla

thank you in advance!

-nub
nubian is offline   Reply With Quote
Old 04-24-2002, 04:58 AM   #2
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

I've never liked (or for that matter used!) the with action!
You can simply use dot syntax.

Your button ain't working because when targeting the main timeline from within a movie clip (or from loaded movies on other levels), scene names are meaningless when the movie is compiled. You would only use the label with _root if it's from a movie clip, or _level0 from a movie loaded on another level.

on (release){
_root.gotoAndStop("sc1");
}

Or...

on (release){
_level0.gotoAndStop("sc1");
}

BTW, when using _level0, it would work both from a movie clip or another movie on another level!

Regards,

oldnewbie is offline   Reply With Quote
Old 04-24-2002, 05:03 AM   #3
nubian
Member
 
Join Date: Apr 2002
Posts: 75
Send a message via AIM to nubian
Default

i tried those already and no luck!

i found out this way works:

on (release) {
tellTarget(_root) {
gotoAndPlay("Scene2",1);
}
}


i remember this from flash 5

i don't like the reason why it works like this but hey it works now.

i thank you very much for replying!

-nub
nubian is offline   Reply With Quote
Old 04-24-2002, 05:17 AM   #4
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

The tellTarget action is Flash 4 syntax and has been deprecated since Flash 5. I use my proposed syntax every day and it works! It's basicly the same as what you're now using. You didn't try it hard enough!

Here's your .swf with this code on your button:

on (release) {
// with (_root) {
_root.gotoAndStop("sc1");
// }
}

http://odin.prohosting.com/~oldnew/scenetest.swf

Regards,

oldnewbie is offline   Reply With Quote
Old 04-25-2002, 04:53 AM   #5
nubian
Member
 
Join Date: Apr 2002
Posts: 75
Send a message via AIM to nubian
Default

i was trying to address scenes by ways means of the scene name not by means of frame lables.

just love the old way in 5
i will have to get use to mx

thanks a bunch for your help!

-nub
nubian is offline   Reply With Quote
Old 04-25-2002, 11:05 PM   #6
Rasterburn
Registered User
 
Join Date: Feb 2002
Posts: 16
Default

did you try this

on (release) {
_root.Scene2.gotoAndStop("sc1");
}
Rasterburn is offline   Reply With Quote
Old 04-26-2002, 12:58 AM   #7
nubian
Member
 
Join Date: Apr 2002
Posts: 75
Send a message via AIM to nubian
Default

i know there are ways of addressing scenes with frame lables.

what i'm really trying to figure out is how to strictly address the scene by ways means of a button stored inside a movie clip. i like to figure out the hard stuff.
nubian is offline   Reply With Quote
Old 04-26-2002, 05:21 AM   #8
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Rasterburn...

_root.gotoAndStop("sc1");

... Works, as my link demonstrate! Adding the scene name is pointless!

Nubian, unless you write your own new Flash application, looking for the syntax to address scenes from movie clips and/or from external movies on other levels is also pointless!
When compiled into a .swf scene names become meaningless, and the main timeline is seen, by those clips or external movies, as one big scene, even if it held several dozens of them when you were creating it. Thus 2 methods to target particular frames

1- A cumulative frame number:

Suppose you want to target frame 1 of scene 3, and you have a preloader scene holding 4 frames, a scene 1 holding 100 frames, and a scene 2 holding 50 frames, you would have to target frame (4+100+50+1 = 155), to get there.
The problem with this method, is that if you decide to edit any scenes before the targeted one (shorten them, for example), you'll have re-calculate that targeted frame number and also correct all of your goto's accordingly! A lot of work and risk of errors!

2- A labeled frame

In the example above, if I label frame 1 of scene 3 with an unique label as my_start3 or whatever, that label will allways remain attached to that particular frame, until I decide to delete it, and no matter how many edits I make in previous scenes. Thus a lot less calculations and almost no risk of errors!

So keep looking for that magic syntax if you want... But you ain't gona find it! Sure, you can still try tellTarget, but dot syntax and labels is a lot less typing, and once you get the hang of it, much easier!

Regards,

oldnewbie is offline   Reply With Quote
Old 04-26-2002, 11:29 PM   #9
nubian
Member
 
Join Date: Apr 2002
Posts: 75
Send a message via AIM to nubian
Default

i thank you very much for your help and support.
i already knew since flash 4 how to address different scenes by frame number with different amount of frames. i found out a way to address a scene via movie clip w/o the use of a button residing within the movie clip and also w/o trying to address the scene by frame lables. =)

i know originally i asked if someone knew how to do this w/ a button residing within the movie clip. but this way there is no need for a button unless you want down and over effects. i was strictly looking for a way to use a mc to jump to scenes w/o the use of frame labels.

lets say you have a movie clip named "buttonMc" you would have to put this action into a keyframe:

buttonMC.onRollOver = function() {
gotoAndPlay("Scene 2", 1);
};

check out my example:

http://www.radermotorsport.com/buttonmc.swf

where there's a will there's a way!

-nub
nubian is offline   Reply With Quote
Old 04-27-2002, 12:16 AM   #10
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Shesssssssssssssssssssssh!

The movie clip still acts like a button and I fail to see the difference between typing a label or a scene name and frame number.
Guess you've just proven that ice is frozen water... Speaking of which, I'm having a beer! Should I ask my fridge to spill out a ("budweiser", 1) or simply a ("bud")?

Regards,

oldnewbie is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static movie clip inside class, placed on the mc scene .... [CVX] lucas ActionScript 2.0 3 12-29-2004 05:46 PM
Simple Movie Clip Button Problem roboron ActionScript 1.0 (and below) 7 12-08-2004 06:43 AM
Button with Movie Clip goto new Scene montex ActionScript 1.0 (and below) 1 12-07-2004 06:40 AM
How to Play movie clip while dragging button? GalacticFruit ActionScript 2.0 1 04-26-2004 01:15 AM
controlling main timeline to anoyher scene frm a movie clip debrizio ActionScript 1.0 (and below) 1 02-25-2003 06:10 AM


All times are GMT. The time now is 02:17 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.