Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Scenes/Labels



Hi.

I am trying to do a very basic slideshow display in flash. the way it is set up is there is an initial menu page, where the user chooses a category to view the slides of, they click on the button, and the slide show begins. within the slide show, there are next/back buttons which cycle through the show.

functionality:
the menu page buttons, when pressed, jump the flash movie to a label within a seperate scene.
the next/back buttons jump to labels with that scene.

the code:

//the next button-

on (release) {
if (currentImage<totalImage) {
gotoAndStop(scene+"Load"+(currentImage+1));
} else if (currentImage==totalImage) {
gotoAndStop(9);
secondLoop = false;
}
}
//all this does is compare the current
//image to the total number of images,
//and then moves forward from there.
//any added complexity is for aesthetic
//reasons. the code is dependent on
//the variable "currentImage" being set.

//each label (i.e. scene1Load2) has an //action in the first frame to set the
//variable "currentImage".

currentImage = 2;

--
the problem:

The code works fine, the slideshow works fine unless the scene with the slideshow is not the first scene in the scene list. So all of my functionality works up until the point where i add the menu page, and then, no matter what is on that page, the code to set the "currentImage" variable no longer triggers when i use the next/back buttons. I have tested this rather extensively, and am certain that everything works when the slideshow scene is first in the list, and the variables no longer set if it is not. This seems to me to be most certainly a bug, but i am hoping that someone has run into this before and has a workaround that does not involve placing the whole movie in one scene, or creating seperate movie clips for each page.

thanks,
jkl



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-06-2005, 02:14 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Scenes And Labels
what are some way to link to a specific scene and a specific label within the scene.

New To Scenes And Labels
Ok, so I have made a bar that loads at the beginning of my movie using actionscript.


where do i go from here?? I know that I have to create scenes for different parts of my site but i dont know how to go about doing it!!!

May seem very simple but i need help with this to create my website.

How do i set up the scenes and labels that the actionscript recognises in the timeline e.g

a scene for "about me"
a scene for "my blog"
a scene for "art"

you get the idea, i want to have buttons that i have made on the first frame(the one displayed after the intro) link to other parts of my website.

I would appreciate all help email me at
shanekillian18@eircom.net

thanks

Pls Help, Labels And Scenes Urgent
Hi there

I've made one movie that works perfectly with links to labels and am happy with that, call this scene one.

i have then duped scene one and made scene two but my labels, even thought I am calling scene two do not work and jump to scene one. do i have to have different label names in scenes or can i use the same... pls help, deadline approaching...

tasvino

Enumerate Scenes/labels
How can you enumerate through all the scenes and labels in a movie ?

Scenes, Goto's And Frame Labels
Has anyone noticed that if the first fame of any given scene has a label then you can't referance it with a gotoandPlay using frame number 1 you must use the frame label or it does what it wants.

so
on (release) {
gotoAndPlay ("scene2", 1);
}
doesn't work

on (release) {
gotoAndPlay ("scene2", "firstframe");
}
does work if your first frame of the movie was labelled "firstframe" why the hell is that!

Scenes - Buttons And Frame Labels HELP
I have a Movie with Scenes 1, 2, 3, & 4. Each Scene has the same 4 buttons that float down from the top of the stage. I, of course, want the buttons to work from within all the scenes.

Should I have Frame Labels for EACH of the 4 buttons in EACH of the 4 Scenes?

OR

Should I use Tell Target and a GoToAndPlay on EACH of the 4 buttons in EACH of the 4 Scenes? If I use this, do I use _root.information and indicate which frame to start and play?

I have done this once before but can't seem to get this to work. Thanks! :-)

Frame Labels Across Scenes (damn Not Again)
Yes, this is a popular question I know, especially for newbs like me. I have followed a typical route of creating websites in one scene since I started using flash a few months ago. I realize there is some contention about using scenes but I really want to in order to have a pre-loader peppered throughout my sites. I have tried in vain to get frame labels to work across scenes but it just isn't happening. I managed to find multiple threads on here pertaining to the subject but the code just doesn't work. Basically I am trying to get scene 1 to link to frame one on scene 40. The frame label being "blah1! Which is defiantly there with its little red flag on the first frame of scene 40.
At the moment I just want it to play the frame label when the timeline hits the right frame but I tried an "on" command as well and it still didn't work. I have tried variations on the same code given on these forums including root and trace and guess what? It still didn't work


So I guess its three questions

What's wrong with this (when I use this the timeline plays frame 1 of scene 1)


on(release){gotoAndPlay("blah1");}


what's wrong with this((when I use this the timeline plays frame 1 of scene 1)

gotoAndPlay("blah1");


and can anyone give me a link that tells me how to load stuff half way through a time line rather than doing it with pre-loaders at the beginning of a new scene?


Oh I meant to say I checked the code I was using by using frame labels within the same scene and they work fine.


Thanks you very much in advance!

and hello for the first time

Scenes, Frame Labels, Is This A Flash 8 Bug?
Hi all, hope you're all well

I have encountered some serious strangeness here.

I have my main scene with two frames on it. Frame one is labeled "start". Frame two "end".

I have some text with "Magic" particles around it. I am using mc tween to fade everything in.
When everything has faded in on the "start" frame, I run a onTweenComplete function to gotoandstop on the "end" frame. The end frame contains a rollover that once activated runs the whole movie again.

All very simple and working correctly.

However when I add a preloader onto a new scene the whole movie breaks.

I have even tried adding the preloader to the main scene on frame one, so that everything is in one scene, over three frames.

I have no idea what is going on.

Is this a bug guys? Have you encountered this?

Heres my code.

Frame 1

Code:

#include "mc_tween2.as"
stop();
this._lockroot = true;

richard_mc._visible = false;
hodgekins_mc._visible = false;
magic_mc._visible = false;
single_mc._visible = false;
september_mc._visible = false;
visit_mc._visible = false;
fake_mc._visible = false;


richard_mc._alpha = 0;
hodgekins_mc._alpha = 0;
magic_mc._alpha = 0;
single_mc._alpha = 0;
september_mc._alpha = 0;
visit_mc._alpha = 0;
fake_mc._alpha = 0;


richard_mc._visible = true;
hodgekins_mc._visible = true;
magic_mc._visible = true;
single_mc._visible = true;
september_mc._visible = true;
visit_mc._visible = true;
fake_mc._visible = true;

richard_mc.tween("_alpha",100,2,"linear",6);
hodgekins_mc.tween("_alpha",100,2,"linear",8);
magic_mc.tween("_alpha",100,5,"linear",12);
single_mc.tween("_alpha",100,2,"linear",19);
september_mc.tween("_alpha",100,2,"linear",22);
visit_mc.tween("_alpha",100,1,"linear",25);
fake_mc.tween("_alpha",1,1,"linear",43);


fake_mc.onTweenComplete = function() {
   
   _root.gotoAndStop("end");
   
}

// Magic particle number
var magic_particle_number:Number = 50;
// Create Empty MC for Magic Rain Stage
this.createEmptyMovieClip("magic_stage_mc", 1);
// Magic Rain Stage X and Y Coordinate
magic_stage_mc._x = 127;
magic_stage_mc._y = 0;
// define magic rain width and height
var rain_box_width:Number = 646;
var rain_box_height:Number = 500;
// Define Magic Rain Function
magic_rain = function (magic_particle_number) {
   for (var i:Number = 0; i<magic_particle_number; i++) {
      // Attach Magic particle to Magic Stage MC from library
      this.magic_stage_mc.attachMovie("magic_mc", "i"+i, this.magic_stage_mc.getNextHighestDepth());
   }
};
// Call Magic Rain Function
magic_rain(magic_particle_number);
// If you want, hide magic rain, use below command
// magic_stage_mc._visible=false



Frame 2

Code:

stop();
this._lockroot = true;

magic_stage_mc.removeMovieClip();//remove magic
//===================== Button
rollover_btn.onRollOver = function () {
   
bigm_mc.tween("_alpha",0,1,"linear",0);
   
rollover_btn.tween("_alpha",0,1,"linear",0);

}
   
//=========================

//===================== Button tween
rollover_btn.onTweenComplete = function() {
   
   _root.gotoAndStop("start");
   
}

//=========================


and my preloader code, hope fully this is where the problem is

Preloader
Code:

stop();

MyInterval = setInterval(preload,100);

function preload() {
   var current = _root.getBytesLoaded();
   var total = _root.getBytesTotal();
   var pctLoaded = Math.round(current/total*100);
   
   loaderBar_mc._xscale = pctLoaded;
   
   if (current >=total) {
   gotoAndStop("main",1);// change to "start" if its on the same scene
   clearInterval(myInterval);
   }
   
}

Similar Frane Labels In Different Scenes?
i have a button sitting on all of my scenes that when clicked will send the movie to a frame near the end where the scene closes up. the button is set to goto

Current scene, frame label: fadeout

but when i put it at the end of each of my scenes it tells me i have duplicate frame labels.

i dont want to have to change the frame label and the button in every scene.... any way to work around this? and still keep it nice and clean

Multiple Scenes And Duplicate Labels Error
Hi,

I'm using Flash 5

I'm trying to create a game with 3 levels. I've created the game with a single level - which exists in Scene - "Level 1".
I thought it would be simple enough to make another Level by duplicating the Level 1 scene and make a Level 2. It works great except that when I load an external movie for a transition movie, when I have a MC(movie clip) on the main timelin of "Level 2" (as well as "Level 1") tell the main timeline to go to a specific label, it goes to the label in "Level 1" (the first scene with that marker), not in the current Scene - "Level 2". I didn't want to specify the scene in these calls since I wanted to use the same MC in all scenes.

Does Flash 5 have a problem with this?
I know that when I publish the movie it complains that I have cuplicate labels. I've tried this with other test movies and it doesn't seem to have this undesirable effect.

I'm using very generic code to tell the main timeline to go to a label:
tellTarget (_parent); {
gotoAndPlay ("Marker");
}

Any help would be very helpful.

Thanks!

Recycling Previous Scenes/labels With GotoAndPlay
Hi all,

A theoretical question for you all and if any one can provide me with the solution even better.

Basically I want to reduce the amount info on my main timeline.

I have an animation sequence called "paper" on the main timeline before playing the next scene "CV1". I want to introduce a new sequence called "CV2" to my timeline.

Is there a way I can reuse "paper" with gotoAndPlay so that once it plays all the way through that sequence it then goes to "CV2"?

Essentially I'm recycling "paper" (no pun intended!) but the end result will be different. e.g. CV1 or CV2 depending on where the user wants to go.

Hope someone can help

Exporting Scenes Separately And/or Importing Scenes From Other Files
does anyone know a way to import a scene from one file to another or a way to export/publish scenes separately (make each scene a different file)

thanks

Sound Across Scenes & Changing Volume In Certain Scenes..
OK, this is kind of hard for me to explain but i'll try...

I want to have a continuous sound loop over various scenes, but I want the volume to increase (i.e. fade up - and i would like it to fade rather than just suddenly turn up) during one of the scenes.. and decrease (i.e. fade out) to 0 during another scene.

On top of that, I'd like the sound loop to stop altogether when they play another audio file on the movie - then the loop resume when they return to scene 1.

Anyone able to help me here - i know it's sounds complicated but I am sure someone knows how i can do this.

Any help would be much appreciated,

thanks,
Chris

Labels
Hi i have a problem here.

I am trying to have 2 person kicking a ball to and thro each other.

I will have a button on each of the person, so that when u click on it, they will kick the ball.

How I do it, is have the two person and the ball all to be a mc.

On the button, when the person clicks onto it, if the ball timeline is at a certain frame, it will play, else it won't.

But I am having trouble referring to where the ball stops(the frame label).

on (release) {
if (ball.stop("onetwo") {
_root.person.play();
_root.ball.play();
}
}

Also do I did to follow a IF with an ELSE??

*********
One more thing. I was loading one movie into another, how can I have the actions still playing??

thanks
Sushi82

Labels
hi

is it possible for actionscript to know if a frame exists with a paticular label?? so lets say I have a label called "john" on frame 60, is it possible to check if the frame with label "john" exists or not?

thanks

phil.

Labels
can i name 2 frames (diffrent scenes) with the same name?

Labels Gone
using flash mx 2004 i had standard labels on my radio buttons. i then use this main movie inside another so i can have an external preloader. everything worked fine, but i must have changed something, because now when i test it, the labels dissapear. When I test the main movie they are still there. But using the preloader they are gone. and when the movie is tested they still work the same, the labels just left. any idea as to what caused this?

How To Add Labels?
Sorry for stupid questions.
But how to add labels on frames in Flash MX?

Preloading Using Labels
i know how to preload using labels, however, if you have labels in movie clips and not in the main movie, how do u target or select them when doing the If Frame is Loaded actionscript? it doesn't show up in the drop down menu. thanx

Preloading With Labels
I already know how to make preloaders however i want to make a preloader with percentage increases (25%, 50%, etc.) I can learn that from tutorials online but the method i want to do that is with labels. If the label isn't near the preloading movie, you do not have the option to select it from the dropdown menu when you select what label you want for the "If frame is loaded ()"

Now what i'm asking is, i need to kno how to identify labels that may be within other movie clips and scenes. I know to identify movie clips you use ../(instance name) instead of the usual /(instance name). how do you do it for labels?

Also if how i'm doing it is impossible, plz suggest another way. thanx

Magnetic Labels
I wonder if any one might know where i could get a tutorial for these magnet tags such like the ones below.
http://www.rawfibre.co.uk/

many thanks

Labels To Text To Get Url..
Ok. I should know the answer to this question, but I fail to know it, at least at the moment.

Ok, Here goes:

I have a text field that offers the user to insert text. Say I have a label that tells the user to input their email address or someone elses. Then they can click on a button to Send the info.
Ok? So. inother words the actionscript would look like:

mailto:?????

How can I get Flash to set the mailto: and the users text from the text field together.

??


Thanks
Chad

Frame Labels
Flash 5 Question: In a short .swf, I am placing frame labels on 1 track, however, each time I insert a frame label, it converts the previous frame label to the same label. If I then fix the one that changed, it then remains correct. What am I missing?

Thanks!

How Do I? - Text Labels
I see Flash sites where text will appear (Scroll on/Fade on) when the user moves the mouse over a button. It the Fades/Scrolls off when the user rolls out! How is this done?
Any help much appreciated!

Frame Labels
I am using a Mac - can frame label names have spaces or should i use an under _ score?

for example in

on (release) {
_root.gotoAndPlay("label in scene")


is it ok to have the spaces?

Add Labels To Listbox
can someone help me with dynamically adding labels to the listbox companents??

thanks for the help
riyan

Labels And Variables
I'm passing a variable which holds a frame label to a function which tells a movie clip to go to that frame label.

Example:

aLabel = "section1";

function launchLabel(whichLabel) {
gotoAndPlay(whichLabel);
}

launchLabel(aLabel);

Flash is not reading the variable whichLabel correctly. whichLabel is passed as a string, but the statement gotoAndPlay(whichLabel); is reading whichLabel as undefined. Is there a way for the method "gotoAndPlay" to call a label using a variable?

Thanks,
Craig

Frame Labels
is there a way to address a frame label like you would a frame number? I'm making a radio and its a living nightmare for me to use raw numbers to advance to the next track. right now I've got this for the next track button

if (_currentframe > 1 && _currentframe < 8659) {
gotoAndPlay(8660);
}

and so forth to advance tracks.... each track has its own lable though... like "Song1" and then "Song2" . What I would like to do is say something like:

if (_currentframe > "Song1" && _currentframe < "Song2" - 1) {
gotoAndPlay("Song2");
}

how can I do that? Or if there is a better method can someone please tell me? this has been driving me nuts.

thanks in advance
--Metalguy

BarChart: Where Are Those Labels?
When you use the component BarChart and move the mouse over one bar you get a label that says:

Label: the label
Value: 50

I´m trying to edit that to tranlate "Label:" and "Value" but cant find where is that. Can someone help me?

Thanks!!!

Linking To Labels?
Is that possible? For example can I add an action to a button saying on release, go to a frame labeled HOME?
Thanks for your help.

Frame Labels
how do i add frame labels in MX....
stoopid ytes but i need to know thnx!!

Dynamic Labels
I'm trying to create a dynamic timeline without using labels.

Right now I have a series of labels counting up the timeline (next1, next2, next3, and so on).

I have a button with a "keypress" function following up the timeline referencing those label.

on (keyPress "<Space>") {
gotoAndPlay("next"+forward);
_root.square = 0;
if (forward<70) {
forward++;
}

Is there a way to make a dynamic label system that will creat it's own numbers and order? It's killing me to have to relabel those numbers in order to have my button follow along.

---- Frame Labels ----
hi hi,
can I use frame labels in actionscript?

Because I did like this ("infostop" is the name of the label):

on (release) {
if (_currentframe=="infostop") {
loader = 1;
gotoAndPlay ("infostop"+1);
}
}

and it doesn't work........
any solution?

Setting Labels
Hey,
I am trying to set a label to like a frame or w/e and as you can see in the attached file, it says to get it to say onFrame and all that but I can't get that. Where do you right click and add the action to get that. I keep getting AtFrame and it not workin! Help PLease!

Creating Labels
Already so far so good. I am reading " Sama Teach yourself Flash MX Actionscript in hours".
Flash has a neat feature to create labels, by using names instead of frames so if you need to move something you dont have to rewrite the script, but it doesn't tell me how to create labels.

Can someone help me with this or know of a good source to get the information?

Section Labels
Hi all,

I have made a map using flash and swift 3d. When a user rolls over a certain hotspot it makes the movieclip underneath play its sequence to make it look like a 3 shape rises from the map so they know where they are. What I want to do is when the user rolls his mouse over the hotspot they get a line from the mouse and at the other end of the line they get a word telling what the section actually is.

Could anyone gove me any indication as to how I could achieve this and how the actionscript could look.

Thanks Pixelmagik

Frame Labels.
Hi Peeps,

Trying to work out how to use frame labels in if statements. Is it possible?? I got something like this, but duh it dont work!! :

if (movieclip._currentframe < movieclip._("framelabel")) {
play();
}

Any ideas? I've never used frame labels like this and I got it all wrong. Maybe theres an easier way to do it so any help would be really good. I dont want to use frame numbers as i've got a lot of moving around to be done.

Cheers.

Steven.

Prevframe - Can This Be Done With Labels?
i have a scrolling text box with up and down arrows...code looks something like this:


on (press) {
_root.textclip.prevFrame();
gotoAndStop("1up");
}

on (press) {
_root.textclip.nextFrame();
gotoAndStop("2down");
}

instead of moving up and down just one frame or a certain # of frames...(nextframe (+ 5))...i want to move to the next and prev labels within the movieclip...is there an easy way to do this?

thanks

How Do You Make Labels
how do i make labels on a layer so that i can make goto commands to go to different labels? you know, the labels that have a little red flag icon. i've been searching through the flash help and can't find anything.

Rollover Labels?
Hi, i think i have seen a post for what i want before but i cant find it, so sorry guys for asking again.

I have 4 little pics..squares.
what i want to do is for, as you roll over each of them a little label pops up...but i can remember the little label attaching itself to the mouse and only comes up when its on the image and moves about attached to the pointer as long as its inside the area.
make sense?
thanks!

Labels Or Numbers In MC?
Hi,
thank you for reading this.

I am using frame labels for button actions in a movieclip. I tried with frame numbers and that doesn´t work. No problem with labels though.

I have seen here on the board that this is common. Now I´m just curious: does somebody know Why? Does Macromedia consider this a problem?

regards
ik.

Frame Labels?
i really have looked everywhere, and i cannot for the life of me, figure out how to create a frame label!! pleeeease help!!!

-glam st. glam

p.s.
i'm using flash mx 2004

Frame Labels
I am working a project (already developed) which has many frame Labels. all with hard coded links in the buttons (ie gotoAndPlay "LabelName") is there an easy way where I can use something like nextFrameLabel previousFrameLabel to jump along and back through the timeline?

Or does anyone have a better method?

Frame Labels Please Help
Hi there, I can't seem to get anyone to help me! I have my site right? now each page is a Scene. (I know I know, I shouldn't use scenes) Everyone tells me that I should use Frame labels, thats fantastic, but when I try to go make them I don't even know where to start so my site will work. I'm going to throw this computer out the window pretty soon....please help...Ive been trying to make these links work for three days now.

Component Help: Labels
Learning as I go along here...

I need to create a solid color background behind a label, but I can't figure it out. I tried using styles, but I don't know the property name. I tried "backgroundColor", "bgColor", and several other variations with no luck. I tried getting the width of the label, but its the same width as I had placed it on the stage. I set it to autoSize left, but my assumption was wrong that it would set its width property to the width of the text as a normal textfield would.

So I ask you, what is the best approach to this?

[MX] Frame Labels
I am trying to follow this tutorial:

http://www.flashkit.com/tutorials/In...-532/more3.php

Which will create scrollbars on my flash website.

My problem is that when it asks me to put in a frame-label of 'load' it seems to label frames 1 and 2, not just 2. Am I missing something or does this always happen? My concern is that I asks me to make more frame labels soon after 'load'.

Also, when I add ActionScript, why is it when I click Frame 2, the ActionScript from Frame 1 is there? Should there not be a blank field for Frame 2?

Thanks.

Labels/actionscript
If anyone can help, I want to write some actionscript that will make a button go to a label i have named 'introduction', i want this to happen once the button has been clicked.

Any ideas how to do this?

Frame Labels
hi, is there any way to tell what frame label a movie clip is currently on, or can you only use the numeric _currentframe?

Help With Actionscript & Labels
Hi,
I am pretty much a nub in Flash & Actionscript.

I am working on a website in flash. As you can see in the code below I created a button. When the button is pressed I used an "if" function about the count.text
If count.text = 0 then I want the movie to play the scene labeled "sunbreak" and then play the label "about".
And I want that if the count.text doesn't equal 0 then it plays "about" directly without playing "sunbreak" first.
I thought I wrote it correctly, but I guess I didn't. Because when the button is pressed, it's like "sunbreak" got played really really fast and then "about" plays. I think that "sunbreak" starts playing and then "about" starts playing before "sunbreak" completes it's animation.

This is what I need basically:
If you press the about button you will get "sunbreak" followed by "about".
If you press the news button you get "sunbreak" followed by "news".
This happens for all the buttons UNLESS "sunbreak" was already played, which in that case, if you press (for example) the news button it will play "news" without playing "sunbreak".


PLEASE HELP!!!!

Copyright © 2005-08 www.BigResource.com, All rights reserved