Advice: Main Timeline Or Object?
Hello guys , When I study the actionScript some tutorials, books, articles... put the action script on main timeline (_root) and somebody use onObject, what should I use or get to use to? or some people prefer main timeline and some use scripting onObject? Is that it? Please, give me advice or what you prefer and if you've got little time to explain it why?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-13-2005, 10:59 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Advice: Main Timeline Or Object?
Hello guys ,
When I study the actionScript some tutorials, books, articles... put the action script on main timeline (_root) and somebody use onObject, what should I use or get to use to?
or some people prefer main timeline and some use scripting onObject? Is that it?
Please, give me advice or what you prefer and if you've got little time to explain it why?
Referencing Clips On Main Timeline From My Main Document Class
Hi All,
I'm trying to reference clips on the main timeline either in or via my main Document class, but if I declare any clips as public in the class body as I would have done is AS when linking an external class, I get:
Code:
1151: A conflict exists with definition tfLength in namespace internal.
If I don't declare the clip, then I can reference it from within the same class with this.tfLength, but other classes complain it the Document classes tfLength variable doesn't exist!
So how do I reference a clip on the timeline in my class?
Thanks,
Dave
Controlling A Movie Clip's Timeline Separately From Main Timeline
I've got a problem here that I've been trying to figure out for a while now, and it seems like it should be way easier than this. Here's what I've got:
I'm trying to make a neato little flash swf with lots of buttons that you can push and another little movie clip will show some little animation.
I thought I could get this done pretty simply by making a bunch of buttons, giving them an over, down, hit, sound, etc. and then having one single movie clip do all of the animations, but cleverly use stop(); and gotoandplay();
I have tried a few different ways, searched through the help & tutorials, looked all over forums on the internets, and I still can't get this to work. The main timeline is really just 1 frame, and its only purpose is to just hold all of the buttons. I have given all of the buttons instance names (ending with _btn). There is a separate layer in the main timeline for the actionscript alone, and was hoping to put all of the gotoandplay commands there. The code that I am trying to use in that frame is:
Code:
this.WV_btn.onRelease = function(){this.productzmovie_mc.gotoAndPlay(2);
};
The productzmovie_mc has a command to stop(); in the first frame, and I am trying to get a button to skip to the next frame to get it going. I put a stop(); on the last frame of that animation so that it won't run through the whole thing on the first button press. If I remove that stop(); on the first frame, the whole animation just runs whenever I test it and the button has no effect.
I thought this would be way simpler than making 25 separate movie clips and hiding them or spawning them. Does anyone know what I could be doing wrong here? This seems like a pretty simple operation, and I am probably screwing up some mundane detail (I always do that). Be gentle, I am trying to learn Flash and I am a bigtime n00b. I can post the .fla if you need to see it, but it's pretty simple so far, just lots of buttons.
Thanks!
ActionScript Differences Between Main Timeline And Movie Timeline?
Hello,
Could someone explain the difference if Action Script is on the main timeline or in a movie clips time line which is on the main timeline?
I guess I mean is with regards to referring to other items or movie clips or external scripts etc.
To try and clarify what i'm going on about....
I have a form that uses a php script. The form.swf is brought into my main movie with 'loadmovie' action script.
When the form.swf is run on its own it works. When someone enters the info and hits 'send' the form gets what it needs from the php script and then goes to a 'sucsess' frame. Great.
But..
When the form.swf is run from within my main movie and someone hits 'send' the form goes to my 'fail' frame (even though it is sending the email), the php script is returning a 'fail - invalid email entered' message to the flash form (the email was valid though!!).
Because the form.swf works on its own I'm guessing that, when loaded into the main movie, i need to add something to make it talk to the php properly.
The odd thing is that it must be talking to the php as it is sending the email!!! So why is the php sending back a 'fail' and not a 'success'.
It could be that the form.swf is just not getting a response from the php and so it going to the fail frame. In which case, if my form movie is within my main movie what do i add to the php (or action script) to receive the info to the nested movie.
I cant work it out.
Thanks soooo much for your help.
Julian
Play Movie In Timeline But Keep Main Timeline In Place
Hello,
Scenerio: You are at frame 1 of the timeline and it's stopped, you hit a button and it jumps you to frame 20 and then at frame 20 a movie clip plays.
Question. Can I have that movie play for however long I want (let's say it's a 100 frame movie) BUT have my main timeline still sit on frame 20? And then when the movie is done playing it goes to frame 21 of the main time line? Currently I have to make my main timeline be the same length as any movie I have in it, and so my main timeline ends up being an absurdly long.
Just a general answer will help - which action scripts would I be looking to use (I'm using Flash 8 Pro)?
Thanks
Main>swf>swf's Help/advice Please
Hi, I'd appreciate some help/advice on getting seperate swfs(3,4,5) open[from a button] when called from a swf(2) loaded into a main swf(1)
ie: main(1)>swf(2)>swf's(3,4,5)
this is what I tried...
on(release) {
loadMovie("3.swf", "_root.placeholder2");
}
I can't figure it out, any suggestions?
Main>swf>swf's Help/advice Please
Hi, I'd appreciate some help/advice on getting seperate swfs(3,4,5) open[from a button] when called from a swf(2) loaded into a main swf(1)
ie: main(1)>swf(2)>swf's(3,4,5)
this is what I tried...
on(release) {
loadMovie("3.swf", "_root.placeholder2");
}
I can't figure it out, any suggestions?
Movie Clip Timeline Vs. Main Timeline
Ok, i have made a movie clip in Swift 3d and have imported it into Flash MX. Now it is in the first frame as flash will place it there and what i would like to have happen is to tell frame 1 that when the movie clip's timeline ends and stops(frame 90) to then move the parent timeline to continue with stuff
If any one reads this please help or refer me to a MX book that is worth the valuble time we think we have!
Mike
Movie Symbol Timeline & The Main Timeline
Hi guys,
There is the frame in my main timeline which has a movie symbol and when the timeline heads reaches & stops at this frame & start playing the movie symbol timeline, i want that when the timeline head reaches at the end frame of the movie symbol timeline, it should take me to the any frame number/label of the main timeline i want.
I tried adding the action to the end frame of the movie symbol to take me to a different frame of the main timeline but it doesn't do anything. It remains at the same frame of the main timeline.
Is there any way out?
Regards, Rohit
Loading A Movie From A Movie On Main Timeline, To A Specific Frame On Main Time Line
I need help loading a movie from a button in a movie on the main timeline. To a specific frame on the main timeline.
i.e. I have a navigation movie, in it is a load of buttons. I want to load separate movies to a blank movie on a specific frame on the main timeline.
I guess I am having target problems, I can load the movie in the main timeline, but not the frame i want it or the the blank movie in that frame.
Main Timeline Vs Mc Timeline Smackdown
I've made a little animation in a mc several instances of which sit looping on the main timeline.
I want these mcs to load at intervals on the main timeline, frame 1, 5, 10 etc. (a kind of twinkling stars thing if you must know.)
The problem is the main timeline overrides the mc's timeline.
I was able to sort of fix this by shortening the main timeline, but I can see this solution is not satisfactory for any number of reasons, and even at the most basic level it seems erratic.
Obviously my understanding of this issue is too theoretical and not practical enough, or the other way around.
How can I force the main timeline to really accept the mc timeline instead of just pretending to?
A Value From The Main-timeline To A Moviclips Timeline
Hi!
I have a movieclip on the scene. I also have a button on the scene and when I press the button I want to send a variable-value to the movieclip. I have a variable set in the actual frame on the main-timeline but the movieclip doesn´t catch that, when traced I get undefined. Can I send a value from the main-timeline to a moviclips timeline?
A Value From The Main-timeline To A Moviclips Timeline
Hi!
I have a movieclip on the scene. I also have a button on the scene and when I press the button I want to send a variable-value to the movieclip. I have a variable set in the actual frame on the main-timeline but the movieclip doesn´t catch that, when traced I get undefined. Can I send a value from the main-timeline to a moviclips timeline?
Control Of Main Timeline From Another Timeline
Working in Flash Pro 8 (on a Mac), I've got a movie clip on the main timeline. Within the movie clip is a button which, upon pressing, reveals a series of three more buttons.
My objective here is that when you press any one of those given buttons that are within the single button that is within the movie clip an instance of which is on the main timeline that it will take you back to a specific frame on the main timeline.
I am having a devil of an unsuccessful time with the concept of connecting back to the main parent timeline from a child timeline.
Any words of direction on how this is accomplished would be, as usual, appreciated.
Christian Seaborn
seaborn.christian@gmail.com
Timeline Troubles - Any Advice?
I'm a Flash newbie and am just learning the ropes. I have a project where I'm to build an interactive timeline. I've started on one version and it's not functioning as well as I would like. I recently found a Flash timeline that I would like to try and model my project after. If anyone can help me deconstruct how to build a similar timeline I would appreciate it.
The example timeline can be found here: http://www.doncesar.com/timeline/Flash/
cheers,
Alex
Scrolling Swf Inside Of Main Swf- Advice From Pellepiano & Flashjunkie
I am conquering slowly the ability to run a scrolling 360 panorama swf on my main time frame. But am not quite there yet.
Flashjunkie gave me a scrolling pic or the HongKong harbor which I dissected, inserted my panorama of a backyard scene and it works great. Even though I am having trouble understanding just how the algebra of the actionscript does it.
www.dittomark.com/360a
Now I need to insert that swf into the main time line at
www.dittomark.com/360
Pellepiano explained how "to load an external swf into a target clip from a button (both being on the main timeline)" using an empty container.
on(release){container.loadMovie("7758backpan.swf") ;
}
But this has not worked yet and one other kind soul suggested:
--- * speed of scrolling is determined by the position of the cursor * --
Because you moved the location of your movie you may not be targeting the mouse properties properly...
check your code on your panorama and make sure you are referencing the _root.mouse
ie....
Speed = _root._xmouse;
I checked the panorama and speed=45. So I am going to experiment with that. Any comments anyone.
Class Variable Main Stage Display Help/advice
Hi there,
I recently bought MX 2004 Professional after being on flash 5 for ages and Im liking the jump so far.
I was looking for tutorials on the internet regarding making classes and displaying the data to the screen.
I found a tute that showed me how to make the class file [Product.as] seperate to the actual FLA file that retains the data, the problem is I cant work out how to display the variable data in the fla file.
the example tute i followed showed how to pipe it to the output but not into textual components on screen
Ive dabbled in other OOP languages so I understand the principles and the example below works but the output to the main stage screen is what im not sure how to achieve. I made a text box dynamic and called the variable Product_1.UID but it didnt display anything.
Quote:
// ------------
// This Class Defines the variables for the products in the shopping cart
// ------------
class Product {
// Declare Variables
var UID:Number;
var Name:String;
var Description:String;
var Price:Number;
// Constructor function
function Product (myUID:Number, myName:String, myDescription:String, myPrice:Number) {
this.UID = myUID;
this.Name = myName;
this.Description = myDescription;
this.Price = myPrice;
}
// Method to return property values
function getInfo():String {
return("Product:" + this.UID + " | " + this.Name + " | " + this.Description + " | " + this.Price);
}
}
and the data in the fla is here
Quote:
// assumes FLA and AS class file are in same directory
var Product_1:Product = new Product(1, "Widget", "A Fine Widget indeed", 12.34 );
var Product_2:Product = new Product(2, "Sprocket", "A Fine Product indeed", 222.34 );
var Product_3:Product = new Product(3, "Thingy", "A Fine Product indeed", 42.34 );
var Product_4:Product = new Product(4, "Whatsit", "A very good one at that", 52.34 );
var Product_5:Product = new Product(5, "That thing", "A Fine Product indeed", 622.34 );
var Product_6:Product = new Product(6, "nerfball", "A Great Braindead thing", 72.34 );
var Product_7:Product = new Product(7, "blogget", "A Fine Product indeed", 82.34 );
var Product_8:Product = new Product(8, "blammit", "A Fine Product indeed", 92.34 );
var Product_9:Product = new Product(9, "blabla", "A Fine Product indeed", 222.34 );
var Product_10:Product = new Product(10, "mojo", "A Fine Specimen indeed", 122.34 );
trace(Product_1.getInfo());
trace(Product_2.getInfo());
trace(Product_3.getInfo());
trace(Product_4.getInfo());
trace(Product_5.getInfo());
trace(Product_6.getInfo());
trace(Product_7.getInfo());
trace(Product_8.getInfo());
trace(Product_9.getInfo());
trace(Product_10.getInfo());
[advice] Trying To Create 2D Circular Nav Object
Hi
i will try and be as brief as possible.
i have been asked to create a nav which is essentially a circle (2D) that when 'idle' reacts very gently to mouse movement by rotating slowly.
on the circle is 4 segments/buttons that when hovered, pauses the movement of the circle and highlights the segment.
when the segment is 'clicked' the circle spins to align the segment with the top on the circle.
at this stage sub nav will be produced, but that i can handle!!
i have posted a very quick rough idea of what i am trying to create here:
http://www.visualrythm.com/spinning.gif
i have found some source code which i might be able to butcher, and if all else fails i can think of a very labourious and somewhat backward way of making it.....
but im hoping one of you masterminds out there will either have some source code, or can point we toward an example that can acomplish this?!
help
[advice] Trying To Create 2D Circular Nav Object
Hi
i will try and be as brief as possible.
i have been asked to create a nav which is essentially a circle (2D) that when 'idle' reacts very gently to mouse movement by rotating slowly.
on the circle is 4 segments/buttons that when hovered, pauses the movement of the circle and highlights the segment.
when the segment is 'clicked' the circle spins to align the segment with the top on the circle.
at this stage sub nav will be produced, but that i can handle!!
i have posted a very quick rough idea of what i am trying to create here:
http://www.visualrythm.com/spinning.gif
i have found some source code which i might be able to butcher, and if all else fails i can think of a very labourious and somewhat backward way of making it.....
but im hoping one of you masterminds out there will either have some source code, or can point we toward an example that can acomplish this?!
help
Main Timeline From MC
Hello,
From now on I think I may avoid using scenes...
__________________________
When my bad guy dies,(_root.energy2.bbar._width<10)
I want my movie to goto the Scene named "level2_intro" and play.
The following script continues to bring me back to the start of the whole movie 2 scenes back.
Actions on the MC:
Code:
onClipEvent (enterFrame) {
if (_root.energy2.bbar._width<10) {
this.gotoAndPlay(9);
_root.gotoAndPlay(4);
}
Actions on Main Timeline (3rd scene) Frame 4
Code:
gotoAndPlay ("level2_intro", 1);
Mc's In Main Timeline
Sometimes when i put a movie clip in my main timeline i can see the movie clip play. But sometimes i can't and it stays on the 1st frame of the mc.
does anyone know why i can sometimes and not other time?
THANX
Main Timeline Or MC?
Hi,
thank you for reading this.
Would you use the main timeline or Movieclips for creating a simple slideshow in Flash MX? What would be the advantages and/or drawbacks to not use the main timeline? Notice that I am choosing not to use the template.
Thanx!
regards
ik.
MC And Main Timeline
I usually prefer to have only one frame on the main timeline or at least just a few.
what is the best way to have movieclips load on the main timeline one after the other so it is like a presentation without using a next button?
Main Timeline
Hi guys,
how do you call the main time line in AS3,
I have an animaition on the main time line that i want to stop from within an event listener function.
I was expecting it to be like:
Code:
function stopAni(e.Event):void {
if (true) {
_root.animation.stop();
}
}
AS3 doesnt seem to like _root though, :S
Cheers
Chris
Main Timeline Var In A Mc?
What was once an easy project has turned upside down.
I need to refer to a variable on the main timeline from within a movieclip.
I'm just defining a variable outside a class on a single frame like this:
Code:
var vid:String = new String;
Later on, I'm assigning a value that needs to be read inside a movieclip:
Code:
var videoPath = this.parent.vid;
It's been a long week and brain hurts. What am I doing wrong?
Thanks!
:grimey
MC Timeline & Main Timeline
Hi all,
This is going to sound very simple, but I'm having some trouble understanding exactly how the timelines work. I've tried searching online but I haven't found what I'm looking for.
I have two animated movieclips. The first one is 50 frames long and the second one is 200 frames long.
On the main timeline, I want to the first clip to play and when that has finished I want the second clip to play. But I put them onto the main timeline, each on a different layer, they play at the same time.
I understand MC's play independently of the main timeline, but I've tried placing the second MC on the 50th frame of the main time line so it will play after the first MS has finished but it doesn't work.
Placing them both on the first frame of the main timeline obviously makes them both play at the same time...
How/where would I position the animated movie clips on the timeline so one plays first then the second one plays?
Can anyone please explain this or maybe point me towards a tutorial?
Many thanks.
Function On Main Timeline
I have a created a function on the main timeline and I am now trying to reference thats function from a child movie. How do I go about this?
Can't Control Mc From Main Timeline
I am having a huge problem getting a button on the main timeline to control a mc I have placed along side it.
I think it has something to do with sytanx:
on (release) {
tellTarget (targetName) {
_root.lib-folder.symbol.gotoAndPlay("mc-label");
}
play ();
}
Is this wrong? I've tried several different variations, all with no results.
Please help!
MC Talks To The Main Timeline.
I am using a tutorial .FLA file. It's got a horizontal motion menu. Anyway, the MC's that hold the buttons are so deep in MCs that i can't talk to the main timeline. I can't even move frame to frame from the buttons that are moving. I've tried the thing that people say to go from the MCs to Scenes. but i just want the main timeline. thanks.
Superhue.
Target The Main Timeline
Hey Guys & Gals,
Need a little advice, I have an MC on the main timeline that allows the user to reset a game once complete. How do I target the first frame of the main timeline/scene from within the MC? Ive tried using _root but that always returns me to the first frame of the MC and not the Main Timeline/Scene.
Thanks in advance!
LEE
Telltarget And Main Timeline
Ok... i have a preloader which sets the variable loaded = "false" in the first frame... at the last frame it sets it to true...now i have a MC which has the following script.
if (loaded == true) {
tellTarget ("/") {
nextScene ();
}
} else {
gotoAndPlay (1);
}
which is supposed to let the MC continue to do it's fade so it doesn't just jump into the rest of the movie... but the logo repeats indefinately and never advances.... HELP PLEASE!
Copying From Main Timeline To MC
I really need some help here, i hope this is possible. I have made an animation that is 90 frames long in my main timeline. I have realised that i may be using this animation many time throughout my movie and i was wondering if there was any to convert/copy those 90 frames to a movie clip. If it's possible could you please let me know, and if it's not possible could you please let me know as well. Thank you very much for your replies.
Jason
Controlling Main Timeline ?
Hi,
I'm having serious problems in trying to control the main timeline (as in scene 1, where you start from) from within a movie clip. The scenario at the moment is that I've got a list of buttons in a movie clip, that clip is within another movie clip which is placed on the main time line. So basically what I'm trying to do is that when any of those buttons are clicked it should play that movie clip and at the end of it should jump to a corresponding scene depending on which button was pressed. I tried using variables but couldn't get it working.
Does anyone here have any ideas how I can make it work?? By the way this happens to be an urgent problem so any quick responses would be majorly appreciates !
Thanks,
Usman.
Why All Of My Mcs (in The Main Timeline) Are In The Same Level?
hello everybody,
I tryed move one of my mc in the scene1 (by action script in a button at the scene 1) but everything move with together!
my script was:
setProperty(_level1, _x, 20);
I tryed "_level0", "_level10", "_level2" instead of "_level1", it didnot make difference!
would anybody please help me? I 'll be appreciated.
Targetting The Main Timeline
I have a movie clip on the main timeline, and it is held on a stop action... now how do I tell the main timeline from within the movie clip to advance past the stop action?
Help and thanks!
Chris
Stoping An MC From The Main Timeline Without Stoping The Main Timeline
My problem is i have a MC that i need stoped or better yet paused when the user puts the cursor over it, and then started again when the cursor leaves the clip. What i have done so far is this: Put a button within a movie clip, then put the movie clip on the main timeline.
The only thing i could think of to get it to stop would be something like:
on (rollOver) {
movieClip.stop();
}
It doesnt work so any help on this is appreciated..
Movieclips And The Main Timeline
Have a preloader in a movieclip placed on the timeline.
Now it calculates the percentage which is fine and works.
Now when the movie loads and percentage gets to 100 there
is a button placed within the movieclip to continue to a label named MUSIC on the main timeline.
the button is not working. What is the correct code
to be used for this script to get the moviclip to recognize the label "MUSIC" on the main timeline.
sorry not at home unable to give the code......
Control Main Timeline With MC?
Can I place a MC on my main scene and control the scene frame with some action script in that MC? Can someone please post a little sample code. I am having issues getting this to work.
Swf Talking To Main Timeline
on the second frame of my main timeline i have a loadMove command.
loadMovieNum ("MyMovie_intro.swf, 1)
this loads my intro.swf. however, once my intro swf is playing it continues to loop my intro mc, which is on the second frame of my intro.swf. at the end of this movie i have tried
_root.gotoAndPlay(3);
which i thought would tell my main timeline to play the third frame (another swf by the name of MyMovie_loadbg.swf)
any suggestions?
C-
Playing MC's In Main Timeline
This is a really basic question:
If I have an MC that has a timeline of 50 frames and I place it in frame one of the main timeline - is there a simple way of having the MC play to the end before it goes on to the next frame in the main timeline or do I have to assign it 50 frames and then place my next MC after that?
Thanks for your help
Controlling An Mc From Another Mc - Not Both On The Main Timeline
Below is a link to what started this -
http://board.flashkit.com/board/show...hreadid=312161
What I want, is to know how I can control an mc within an mc on the maintimeline from within another mc also on the main timeline...
Do I go back to _root and then up again, or just directly access the mc I need to?
MC Reference To Main Timeline
Hi, hope someone knows how to solve this...
I need a script located at the last frame of a MC to tell the main timeline to go to frame 119.
_root.gotoAndPlay (119);
On that frame lies another script that goes to the next scene.
But instead of doing so, I goes back to the first scene, I don't understand why...
Thanks for your help, Simon.
[Edited by Vazio on 06-05-2002 at 05:27 PM]
Targeting The Main Timeline.....
Im having trouble altering which frame the main timeline is on via a button thats within and mc on the main timeline.
So yeah, ive tried having a telltarget that points simply to "_root." and then says gotoAndPlay (260)
I also tried something like
On release
_root.gotoAndPlay (260)
and still it doesnt work.
So how, from a button inside an mc on the main timeline, do i change the frame that the main timeline is on?
Grexen
Go To Next Frame On Main Timeline From Mc
hi people
i'm inside a mc and it's just finished playing. now i want the playhead to go to the next frame on the main timeline and play on
can anyone help me?
cheers
Main Timeline Problem
Hey,
How does one prevent a preloader in scene 1 being played when targeting the main timeline from scene 2?
(i.e. tellTarget ("_level0") or tellTarget ("_root") gotoAndPlay (10)) etc.
Help!
Cool.
D.
|