Navigating to Frame Label In a MC
Hi All,
I need some help and I will try to explain what I am trying
to do the best i can.
I have a flash movie that has a mc called "pages" in Scene1.
In the mc "pages" I have 4 key frames each representing 4 pages
(i.e. 4 movie clips each one representing a page).
I have buttons in each of these pages. My question is this.
How can I navigate from a button in a page to another page
specifically going to a frame label? I can get to the page using
this ActionScript:
on (release) {
_root.pages.gotoAndPlay(_root.link = 3);
This works. The above example takes me to page 3. However, I
not only want to get to page 3 but specifically go to a frame label
in the mc that I am identifying as page 3.
Any help is much appreciated.
Scott
you do not assign a value to a variable within the
gotoAndPlay method. you should state this call as:
_root.pages.gotoAndPlay(3);
if navigating to a label within that MC, ie:'pages.MC3', you
may need to assign a variable like you're trying to do above, but
in a different manner. since you already have 'link' on the root
timeline, assign the label value to it instead of a number (change
it to a String var), then in the four MCs, add a conditional
statement to the first frame which then 'decides' where to go when
the MC is instantiated. like for instance:
if(_root.link == 'home') {
gotoAndStop('home');
}else if(_root.link == 'about') {
gotoAndStop('about');
}else if( ...
but make you assignment of this var separate from the call
that you'd used above, as in:
on (release) {
_root.link = 'home';
_root.pages.gotoAndPlay(3);
EDIT: sorry kg, typing ... as per usual :)
Similar Messages
-
Navigating to Frame Label in mc from main timeline
Lets say that in my main timeline, I have a number of frame
labels. On stage I have a movie clip (let's call it bg_mc) which
contains a tweened animation that has been looping repeatedly (so
it has its own timeline with its own frame labels).
I would like this to happen:
- On the main timeline, the playhead enters a specific frame
called "newBackground."
- When that happens, I want the playhead in bg_mc to jump to
the first frame in its timeline, "beginLoop."
How do I accomplish this?
Thanks so much for your help!
DavidNow, this brings on another question... that is, what if the
opposite is true?
For instance:
The main timeline plays to a stop(); at frame 10.
At frame 10, a movie clip (countdown_mc) which contains a
countdown timer, begins.
When the timer reaches 00:00, I want to trigger the main
timeline to continue and play the next frame (11).
Thanks again for the great advice,
David -
Error 1009: Buttons Linking to Frame Labels?
Hello here is my code for my buttons for my rather simple Flash site. I have 5 "frame labels" each label contains a set of frames representing a page. Yet when I test the site with the action script below it freezes on the first frame and gives the message
Error #1009: Cannot access a property or method of a null object reference. at SelfPromoSite_fla::MainTimeline/frame1()
This is my code below for my main navigation buttons
Home_Btn.addEventListener(MouseEvent.MOUSE_DOWN, goHome);
function goHome(event:MouseEvent):void {
gotoAndPlay("Home");
About_Btn.addEventListener(MouseEvent.MOUSE_DOWN, goAbout);
function goAbout(event:MouseEvent):void {
gotoAndPlay("About");
Resume_Btn.addEventListener(MouseEvent.MOUSE_DOWN, goResume);
function goResume(event:MouseEvent):void {
gotoAndPlay("Resume");
Work_Btn.addEventListener(MouseEvent.MOUSE_DOWN, goWork);
function goWork(event:MouseEvent):void {
gotoAndPlay("Work");
Contact_Btn.addEventListener(MouseEvent.MOUSE_DOWN, goContact);
function goContact(event:MouseEvent):void {
gotoAndPlay("Contact");
Also on the "Work" "page" "set of frames" I have buttons to advance between frames.
button1.addEventListener(MouseEvent.MOUSE_DOWN, goBack);
function goBack(event:MouseEvent):void
prevFrame();
button2.addEventListener(MouseEvent.MOUSE_DOWN, goForward);
function goForward(event:MouseEvent):void
nextFrame();
I've tried putting this action script on the frame where the "Work" label starts and the actual buttons for advancing back and forth are located. I've also tried putting the action script for these buttons on the first frame with the remainder of the button action script above, it does not work. Also when I remove the 2nd set of actionscript altogether the site still freezes on the first frame.The 1009 error indicates that one of the objects being targeted by your code is out of scope. This could mean that the object....
- is declared but not instantiated
- doesn't have an instance name (or the instance name is mispelled)
- does not exist in the frame where that code is trying to talk to it
- is animated into place but is not assigned instance names in every keyframe for it
- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved. -
Is there a way to return the value of the frame labels?
I want to create a list of all the frame labels to use as a
navigation tool.
Thanks.
Rob ChildressOk - so is there a way to randomly select a frame label along
a timeline using AS1 or AS2? I have 4 labels along approx 2500
frames that I need to randomly go to on load. Just a random quote
rotator. I'm currently using this:
labelselect = random(_currentframe)+1100;
_root.allquotes.gotoAndPlay(labelselect);
Thanks ... -
FLV/Mp3 Cue Points for Accessing Frame Labels on the Main Timeline in Flash 8
Hello,
In Flash MX2004, creating cue points for syncing locations on
flv and mp3 files to locations on the main timeline included:
1) Dragging a media component onto the stage
2) Entering file path, frame label name, and time code
information in the component inspector
3) Creating the frame label names on the main timeline, and
4) Enabling the Media Labeled Frame Cue Point Navigation
Behavior
Flash 8 documentation details a considerably different
process of creating cue points. While it discusses how to create
cue points in the flv, I have not been able to locate how to enable
linking locations in flv and mp3 files with frame labels on the man
timeline. It appears that there would need to be ActionScript
necessary to accomplish this that is not available in the docs.
Please advise what ActionScript/process would enable this
function.
Thank you!
James
[email protected]I usually start off solving problems with the livedocs, as I
recommend for anyone. The following link will take you to the
NetStream.onCuePoint handler. This is what you need.
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context= LiveDocs_Parts&file=00002561.html
You can have this code on the main timeline. When the
cuepoint is hit, it will invoke this event handler and inside is
where your gotoAndPlay( ) should go.
Your other question about the text will get activated by the
same handler. Just have a conditional statement (if, switch, etc.)
to differentiate between the two events. The text itself can be
mask inside a movieclip.
Does this help? -
Creating new buttons on different frame labels
can someone tell me if im doing something wrong or assigning
the as to the wrong frame?
first off i have all my buttons on frame 2. im creating a
real estate site and i have to have a couple links like HOME ABOUT
BUYING SELLING CONTACT, the thing though is that in the BUYING and
SELLING frames i want to add more sections and links but only on
these 2 other parts of my site. when i code it and add new buttons
to these sections though my movie plays over and over and over non
stop. heres my coding...
FRAME 1 preloader
Frame 2 has a frame label of home and all the buttons on a
diff layer, and AS3 on a different layer
Frame 3 has a frame label for about section
Frame 4 is my contact for example
so if i create a new button in the about frame label and just
add the code to the working as3 code on frame 2 my movie just plays
over and over and over again, and all i want it do do is act like
the other buttons and go to a different frame label down in the
time line. the only way i get it to work is if i have ALL my
buttons on frame 2.
frame 1
my preloader
frame2
home_btn.addEventListener(MouseEvent.CLICK, onHome)
function onHome(event.MouseEvent):void
gotoAndStop("home");
about_btn.addEventListener(MouseEvent.CLICK, onAbout)
function onAbout(event.MouseEvent):void
gotoAndStop("about");
etc....
etc...
i enter my btn code just like this and the buttons on frame 2
work but any new buttons i try and creat and put into different
frames othere then frame label "home" aka frame 2 wont workcorrect.
there are lots of ways around it. but they all require the
object to exist when the code executes.
with as3 it's particularly easy to create objects, code for
them and then add them to the display list later when
needed. -
If / Then for Buttons to go to Frame Labels?
Hello.
I'm asking for some hand-holding on this one. Hopefully I can explain this well enough.
I have a complex button that when rolled over the playhead goes to Frame Label textOut.
When a roll out is executed, the playhead is to go the Frame Label textIn.
Easy enough.
mcBtnHome1.addEventListener(MouseEvent.ROLL_OVER, dropText);
function dropText (evt:MouseEvent): void
mcBtnHome1.gotoAndPlay("textOut");
mcBtnHome1.addEventListener(MouseEvent.ROLL_OUT, raiseText);
function raiseText (evt:MouseEvent): void
mcBtnHome1.gotoAndStop("textIn");
mcBtnHome1.addEventListener(MouseEvent.CLICK, landHome);
function landHome (evt:MouseEvent): void
mcBtnHome1.gotoAndStop("textStay");
The problem occurs when I plug in the third event, the click. I click the button, and the playhead moves to Frame Label textStay, as it's supposed to, but once I roll out/ off of the button, the roll out action is again executed. Once I click on the button, no more interaction is supposed to be possible.
This happens despite my having a stop(); action at the textStay frame.
I'm guessing I need an if / then of if / else statements, with some true / false declarations, but I've no clue as to what "if's" I should be checking for.In your click function you could remove the ROLL_OUT listener, and then reassign it when you get to your textStay frame.
(Edit - actually, you probably want to assign that ROLL_OUT listener in the ROLL_OVER function at all times)
mcBtnHome1.addEventListener(MouseEvent.ROLL_OVER, dropText);
function dropText (evt:MouseEvent): void {
mcBtnHome1.addEventListener(MouseEvent.ROLL_OUT, raiseText);
mcBtnHome1.gotoAndPlay("textOut");
function raiseText (evt:MouseEvent): void {
mcBtnHome1.gotoAndStop("textIn");
mcBtnHome1.addEventListener(MouseEvent.CLICK, landHome);
function landHome (evt:MouseEvent): void {
mcBtnHome1.removeEventListener(MouseEvent.ROLL_OUT, raiseText);
mcBtnHome1.gotoAndStop("textStay"); -
Cs3 bug - global objects and frame labels
Just found a bug that took me an hour to figure out.
A strange problem occurred when I had a global object and a
frame label named the same.
Example:
_global.discussion = new Object();
//lots of functions here
I was directing the timeline of a movieClip to the frame
label "discussion". On this frame there were a number of actions
involving the discussion object. However, flash was treating the
object as if it didn't exist. All variables / functions residing in
this object were completely gone. Has anyone seen this problem. If
not, watch out for it.
jamesthat's coder bug, not a flash bug.
-
Wacky problem with Frame label
I have a menu set up with three items. Menu item one has
"gotoAndPlay("video"), menu item two has
"gotoAndPlay("somethinghere") etc...
My menu items two and three always jump to the correct frame
label. I am having a problem with the first menu item.
When you click through the menu items slowly, content loads
in correctly, but it seems that if you click different menu items
too fast, the first menu item jumps back the main timeline to frame
1. My menu is inside of a movieclip. This is where my frame labels
are.
Has anyone ever seen an issue like this before or know how to
prevent this wacky behavior?use the goto methods, not functions:
_root.gotoAndPlay("video"); -
Hi:
How can I code a button that goes back to the previous frame
label and another that goes to the next frame label?
I know about prevFrame() and nextFrame(), but I need
something similar that references the next/previous named label and
not the frame number... Any ideas?
thank you,
Rafael.I don't think someone who is 'new to flash' will not be able to get this by just having the attributes and properties mentioned. (If you can do that, you're pretty good at it already). Maybe someone can help me with this simple test Flash (which should serve as a begineer tutorial). (If you are a Flexer, I have made a Flash timeline with three Frame Labelled sections: "One", "Two" and "Three". Each has two buttons ("nextButton" and "prevButton") along with a text number on the stage, denoting which frame section we are on). Here is the Actionscript code:
stop();
import flash.events.MouseEvent;
nextButton.addEventListener(MouseEvent.CLICK, onNext)
function onNext(event:MouseEvent):FrameLabel
gotoAndStop(nextFrame);
prevButton.addEventListener(MouseEvent.CLICK, onPrev)
function onPrev(event:MouseEvent):FrameLabel
gotoAndStop(prevFrame);
With this, I get the error:"ArgumentError: Error #2109: Frame label function Function() {} not found in scene Scene 1." I think this means that I'm supposed to define a function (is it the function that calls my FrameLabel array?). How do I do this? -
So when I compile an fla in CS6 that I built in CC, It replaces all my symbols and puts "m:" in front of all the names.
Not only that, but on compile, it duplicates layers and frame labels within selected movieclips and then spits errors out calling duplicate functions and frame labels as the issue. Has anyone ever run into this?Figured it out. I had a certain naming convention for my symbols (m:video_1). Turns out that CS6 didn't like the colon and was duplicating my symbols in the library and screwing up a bunch of other stuff too. I changed my naming convention in my library to m_video_1. Adobe take note!
-
Please help!! I have a drop-down menu that I created inside a
movie clip. Each drop down has a button behind it. What I am trying
to do is make it so when each button behind each menu item is
clicked it goes to a particular frame (label) on the Main time
line. I can set the "get URL" action to each button and it works,
but it won't let me apply the "go to frame label" action. I am
stumpped because when I go through the process and select the right
scene then pick frame label the label I created is recognized in
the drop down. But when I go to test it it does nothing...
In short... I want to add a "go to frame label" action to a
button inside my "drop-down" movie clip that goes to a frame label
on the Main timeline.
Any advice would be greatly appreciated.yes, the actionscript you should use is just as you listed.
give each frame a unique label so there's only one "dom". there
should not be one "dom" in scene 1 and one "dom" in scene 2.
if there was a situation where you wanted to use "dom" in
scene 1 and "dom" in scene 2, use "scene1_dom" and "scene2_dom" or
something else easy to remember and suggestive.
i dont understand your question unless you're clicking that
plus sign in the actions panel. you can find the goto function
under global functions/timeline control. but you should use the
timeline or movieclip method: _root.gotoAndPlay() and
_root.gotoAndStop(). -
Why can't I change the frame label type?
In a movie clip, I have several frame labels applied. The type of label is set to Name, which is the default. I want to change some of them to Anchor (to use as named anchors with fscommand), but the Type drop-down list is grayed out. Anyone know why? I can't find any info on named anchors, not even in the Help. Yes I know that anchors don't work everywhere, but this is for a specific client.
Well, that's strange.
In all the named frames of Video MC, I wanted to change the frame label type from Name to Anchor. The drop-down list was grayed-out, and clicking it didn't do anything. That is.......until I exited Flash and restarted it. Now, I can click the drop down list and select anything I want. I suppose I should have thought of that earlier.
Thanks, and I hope I didn't take too much of your time! -
Link to frame label instead of frame #?
How do I modify the following code to link to a label instead
of a frame #?
Btn1.addEventListener(MouseEvent.CLICK, buttonClick1);
function buttonClick1(event:MouseEvent):void{
gotoAndStop(30);
Thanks!!!1. Is there a reason why I would use the second segment of
code vs. the
first one?
2. It seems to me that it would make sense to always link to
frame
labels vs. frame numbers in case you choose to move items
around in your
timeline. Is there any reason to not use frame labels vs.
frame numbers?
Thanks!!!!
kglad wrote:
> no. if the frame label is "contact" you would use:
>
>
>
> Btn1.addEventListener(MouseEvent.CLICK, buttonClick1);
> function buttonClick1(event:MouseEvent):void{
> gotoAndStop("contact");
> };
>
> // or
>
> var frameLabel:String = "contact";
>
> Btn1.addEventListener(MouseEvent.CLICK, buttonClick1);
> function buttonClick1(event:MouseEvent):void{
> gotoAndStop(frameLabel);
> };
> -
[AS] Access Text Frame Labels in CS5
Hello Everyone,
I am updating a CS2 InDesign AppleScript to CS5 and finding an issue accessing the text frame labels. In CS2 the script below would set the variable x to the contents of the text frame "bob", unfortunately, this script not longer works in CS5.
tell application "Adobe InDesign CS2"
set x to contents of text frame "bob" of active document
end tell
The documentation tells users how to insert text, but not access it. If anyone has an idea of how to do this in CS5 I would appreciate it.Got it!
tell application "Adobe InDesign CS5"
tell active document
set x to contents of item 1 of all page items whose label is "bob"
end tell
end tell
Maybe you are looking for
-
I ONLY WANT TO DOWNLOAD ACROBAT FOR PDF FILES, BUT WHENEVER I TRY, IT DOES NOT ACCEPT MY PASSWORD WHICH I HAVE CHANGED RECENTLY...?!!!
-
I'm running CS5 on an iMac 27" (Intel Core i5 2.66 GHz, 8GB RAM, 7200RPM drive) and it is incredibly slow, especially when bringing in objects from Illustrator (smart objects) and resizing them. I'm working on a docuement that is only 50MB in size a
-
Linking files between Macs and PCs in InDesign
I'm Mac, my colleagues are PC. They have removed the letter mapping from their server links to enable me and them to share InDesign files seemlessly. This works perfectly until an Indesign file draws graphics from two (or more) seperate servers. In t
-
MySQL question regarding default values
For the contacts management tutorial the contacts table ('contact_con') lists data for names as: `name_con` varchar(50) NOT NULL default '' However, in the PHPAdmin panel the "default" field is referenced by a footnote which reads: "For default value
-
Can I import and open raw files on the new photo app?
Hi, Can I import and open raw files on the new photos app on my ipad? Does it convert it to jpeg automatically when you want to share them? Thanks.