Address Root Timeline From Loaded Swf
OK, I am a newbie at anything past the basics with Actionscript, so bear with me, please. Here is what Iam trying to do:
I have a movie where the start is a group of people, when you click on an individual, they get bigger and the others shrink and some text appears describing the selected person. The way that I am trying to do it is: The starting swf has the group, clicking on a person starts the playhead and the image fades out. The mouse event also loads a swf on the next level that has the selected person large and the others small. The loaded movie fades in as the level 0 movie plays and stops. The effect is very nice.
However, then I want to click on the now small figures and load the appropriate swf on another level and unload the one previous. I have placed buttons on the swf that gets loaded with the script to unload movie and go to a point on the level o movie where I have an action to loadmovie that corresponds to the particular person.
The first one works, but that's it. I can't seem to address the timeline of the level 0 movie (_root?) to start the playhead to move to the frame label where the action is.
I am trying it this way, because I don't want the different images to load until someone wants them to. The bitmaps are kind of big. I could just have them all in the same swf at different places on the timeline. That just seems so clunky to me.
Anyone with any suggestions? Sorry to go on so long.
Thank you.
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-30-2001, 01:24 AM
View Complete Forum Thread with Replies
Sponsored Links:
How To Address The Main Timeline From The Loaded Movie?
Hi,
i got a movie loaded in my main timeline(_root) in the frame 20.
and i got a stop() action as well in the same frame. Am loading the movie at a level8. now, i want once the loaded movie is finished playing, i want the main timeline's playHead move to frame21.
so, what i did was, i written the code in last frame of the loading movie like this:
_root.gotoAndStop(21);
\this doesn't work.
__root.nextFrame();
\this too doesn't work.
can i use some sort of function, to sort my problem?
View Replies !
View Related
How To Address Main Timeline From The Loaded Movie?
Hi,
i got a movie loaded in my main timeline(_root) in the frame 20.
and i got a stop() action as well in the same frame. Am loading the movie at a level8. now, i want once the loaded movie is finished playing, i want the main timeline's playHead move to frame21.
so, what i did was, i written the code in last frame of the loading movie like this:
_root.gotoAndStop(21);
\this doesn't work.
__root.nextFrame();
\this too doesn't work.
can i use some sort of function, to sort my problem?
View Replies !
View Related
Targeting Root Timeline From Loaded .swf?
OK, here's what I'm doing -
from within an external .swf loaded, into _level1 of my main timeline,
I'm scripting:
stop()
_level0.gotoAndStop(10)
I'm successfull in communicating this command to the main timeline,
the problem is that this command is also being performed on the timeline of the external .swf - not what I want to have happen.
How do I perform this command on the main movie without effecting the timeline of the external .swf?
Thanks
View Replies !
View Related
Tell Root Timeline To Play From Loaded Swf?
Hey all!
This forum is awesome! i usually use the search function and find heaps of stuff! Thanks so much!
This thing is probably really simple though, so the search isn't really helping!
I just need to ask the _root. timeline to play or gotoAndPlay from an external loaded swf...
I've loaded the swf into level 10...and the external swf has a button in it scripted with:
on (release) {
_root.gotoAndPlay(21);
}
this SHOULD work shoudn't it?? i haven't done the lockroot thing, so it should go to its own root timeline...it should go to the containers root timeline?!?!
help?
Thanks in advance guys!!!
View Replies !
View Related
Acces The Root Timeline From A Loaded Swf?
Hi everyone,
I'm building a kind of rss reader for a website.
The website consist on a main swf with the menu that loads external swfs files for each button. For the button "news" i load my rss reader wich is a single .swf (rss.swf)
The file "rss.swf" reads an XML and generates a movie-clip that holds all the infos (and items) of my feed. I called it 'panorama'.
Everything works well but when i load the "rss.swf" from the main swf, my panorama mc does not appear.
I allready got this problem with as 2.0 cause since i'm loading it from another "_root" timeline, all the hierarchy is modified. I fixed this by adding my panorama mc on the root timeline
Code:
_root.createEmptyMovieClip("panorama",1);
and the movie clip was visible then...
But now that the "_root" is gone,
how can i attach my generated "panorama" mc in the "main.swf" file?
or
how can i see a movie clip that has (should have?) been generated by an external swf?
Thanks for your help. I hope it's clear. Here is my code (working in 'standalone'):
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
var xml:XML;
var panorama:MovieClip;
var iteminfo:MovieClip;
var desc:desc_mc;
var date:date_mc;
var ititle:title_mc;
var ldd:ldd_mc;
var frame:frame_mc;
panorama = new MovieClip();
function onLoaded(e:Event):void {
xml = new XML(e.target.data);
var il:XMLList = xml.item;
for (var i:uint=0; i<il.length(); i++) {
iteminfo = new MovieClip();
desc = new desc_mc;
//desc.name = "desc"+i;
desc.x = 213;
desc.y = 31;
desc.descvar.text = il.description.text()[i];
iteminfo.addChild(desc);
ititle = new title_mc;
ititle.x = 213;
ititle.y = 0;
ititle.titlevar.text = il.title.text()[i];
iteminfo.addChild(ititle);
date = new date_mc;
date.x = 494;
date.y = 4;
date.datevar.text = il.date.text()[i];
iteminfo.addChild(date);
var imgLoader:Loader = new Loader();
imgLoader.load(new URLRequest(il.thumb.text()[i]));
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
function onLoadComplete(event:Event):void {
imgLoader.x = 0;
imgLoader.y = 0;
}
ldd = new ldd_mc;
ldd.addChild(imgLoader);
iteminfo.addChild(ldd);
frame = new frame_mc;
iteminfo.addChild(frame);
iteminfo.x = 0;
iteminfo.y = 190*i + 20;
panorama.addChildAt(iteminfo,0);
}
addChild(panorama);
}
panorama.x = 100;
loader.load(new URLRequest("/newsfeed/feed.xml"));
View Replies !
View Related
Referencing Root Timeline Within Loaded Movie
Hi, I've got a movieclip that's going to be loaded by the main stage and I'd like to know what the correct path would be inside the clip to access it's local main stage, since _root will be the parent movie clip.
The module worked fine on its own when I made _root references but now that it is to be loaded by another movie I have to replace _root with a different path. I'm somewhat familiar with levels and have been trying different things but to no avail.
View Replies !
View Related
Pausing Root Timeline In External Loaded SWF
Hi peeps, I'm having a problem with an externally loaded SWF, more specifically the temporary pausing of the playback head in the timeline within it.
My main movie consists of about 10 scenes each with 200+ frames of tweened animation and general info presentation. If the user walks off and doesn't move the mouse for a period of time then the presentation switches to auto-mode and loads the external SWF using this code:
// moves to a blank scene so as to keep background tasteful.
var userActive:Boolean = false;
var activeIntervalID:Number;
this.onMouseMove = function():Void {
userActive = true;
}
function noActivity():Void {
gotoAndStop("blank", 1);
loadMovieNum("fscommand/auto.swf", 1);
}
function activeTest():Void {
if(userActive) {
userActive = false;
} else {
noActivity();
}
}
activeIntervalID = setInterval(activeTest, 10000);
- - - - - - - - -
So far, so good. it works fine to this point, and the external SWF loads A-Okay.
The auto mode is a SWF of the same 10 scenes but instead of button clicks triggering a progression through the presentation, I have a script on the relevant frames to hold the playback head for a few seconds, then the playhead continues onwards through the slides of info. This 'pausing' code is a frame script as follows:
_root.pauseCount = 0;
function pause(pc) {
if(_root.pauseCount == pc) {
clearInterval(pauseInt);
play();
trace("fishy!");
}
else {
_root.pauseCount++;
}
}
pauseInt = setInterval(pause, 0, 5000);
stop();
Now the problem. When saving and previewing this auto-mode SWF on it's own, the pausing works correctly, it then continues to play, and the output window displays 'fishy!', but when loaded in through the container presentation the SWF seems to pause for the correct amount of time but then reverts back to frame 1 and loops continuously instead of continuing along the next part of the timeline. No 'fishy!' either.
I've added "_lockroot = true;" into the child SWF as instructed when I posted this question on the Kirupa forum last week:
See forum thread here
I'm seriously frustrated by the problem, and it's driven me to posting the file online (in a cut-down form) for opinions and guidance. Help seriously appreciated.
Download the files from my server here
Thanks in advance, alancan.
View Replies !
View Related
Navigate Back To Root Timeline From Loaded Swf
Okay I have two swfs (intro.swf & animation.swf).
into.swf loads animation.swf on frame 2. Once animation.swf is finished playing I am trying to go to frame 3 of intro.swf.
I have tried the following code on the last frame of aniimation.swf as follows: MovieClip(root).gotoAndPlay("3");
This does not seem to work. Help!
View Replies !
View Related
Targeting A Frame In The Main Timeline Of The Root From An Externally Loaded Movie
Hi! I'm trying to target a frame called "home_portfolio" on the main timeline from a loaded swf. Here's the code on the portfolio button:
on (release) {
tellTarget ("_root") {
gotoAndPlay("home_portfolio");
}
}
On the "home_portfolio" frame is an action to load the portfolio movie. However, it ignores this.
After reviewing some of the other posts I've changed the code on the portfolio button to be"
_root.gotoAndPlay"home_portfolio"
yet when I publish the swf the output says
Symbol=_bottom nav, Layer=text, Frame=1: Line 1: ';' expected
_root.gotoAndPlay"home_portfolio"
I don't understand why either one of these codes won't work. Can you help? Thanks so much
View Replies !
View Related
Controlling Root With MC Loaded Into Empty MC On Root
I have a movie in which there are 7-8 Empty movieclips put on the stage. I load movieclips into these on load and from some Btns on the main or root movie. Now I'm trying to change out one of these empty MCs from a MC loaded into another empty MC....If that makes any sense?? Here's the code:
code:
onPress = function () {
this.gotoAndPlay(frame);
if (code == "1"){
_parent.getURL(site, target);
}
else if (code == "0"){
fscommand("exec", fs);
}
else if (code == "2"){
_root.clipnmone.loadMovie(movie, clipnmone);
_root.clipnmtwo.loadMovie(movie2, clipnmtwo);
}
}
I'm getting the Vars clipnmone & clipnmtwo But I can't seem to hit the clip on the root movie. It's called clip4. Now, it works if I put the clip name in place of the Vars. If someone could point out what I'm doing wrong, that would be great. Thanks for your help and time on this. Oh, and I'm using Flash vers 6. So, please don't send me 2004 code. Thanks.
View Replies !
View Related
Timeline Controlled By Explorer Address?
Hi!
I've got a question for all of you FLASH-masters out there.
I'm currently working on a website, based on ASP and a database. It loads the content on the page from a database.
Now to the problem. I've got a flash menu/image viewer at the top of the page. ( ex. When I klick on "About" the menu/movie clip shows an "About" image). The problem is that the website is based on only ONE page (default.asp) So, whenever I klick on a link, let's say "About" the page reloads and the About page is shown, BUT! the flash menu/movie is reloaded and moves back to the start of the timeline ( In this case the "welcome" image).
My question is: Is there a way to tell what part of the movie clip to be shown based on the explorer address, or is there another way around this problem?
I don't want to use frames on my website because then the scroller is "miss placed".
I hope I have explaind my problem fairly well, so you all can understan what the h*ll I'm talking about.
Thank you!
View Replies !
View Related
Targeting The Root Timeline
i have a menu which is a movie clip that slides about on stage I got buttons on this menu that are supposed to jump back to a frame labelled on the main timeline. i have a feeling its got something to do with targeting the root timeline in actions for the button but I cant get no joy - could anybody help?
View Replies !
View Related
Accessing The Root Timeline
Hello,
I have a set of buttons that are contained within a movieclip and all I simply want to do it to tell flash to go to a frame on the root time line when a button is pressed.
However, flash will not accept the code (or variations I have tried) as follows:
on (release) {
_root.gotoAndPlay("10");
}
However, this doesn't work and the output window kindly tells me that: "Statement must appear within on handler
_root.onRelease"
Being unexperienced still i'm not sure what that means!
Anyhelp appreciated - I'm sure it's simple!
Thank
View Replies !
View Related
How Do I Control Root Timeline?
Hi flash experts,
i have encounterd a problem with an external swf that i externally loaded to the main movie/root timeline.
what i'm trying to achieve is quite simple. i want to be able to click on one of the butttons in the loaded swf to controll the root timeline. here is the actionscript i'm using but it didn't do anything. i'm using frame lables.
on (release) {
_parent.gotoAndStop("none");
}
am i missing something?
cheers,
samboy
View Replies !
View Related
Targeting Timeline Of Swf From Root
I have my buttons on the root, with a holding mc that I load my swf's into. Is it possible to target a certain frame or label within the loaded swf. The idea is to target a frame in the swf that is in the holding mc so that it animates out prior to a new swf loading in.
View Replies !
View Related
Can I Make A MC Of The Root Timeline?
I've just spent a few hours making this frame by frame animation across a number of layers, all existing on the main timeline in flash.
I've just decided, I would rather this animation be housed in a movieclip, so I can move the whole thing around easily. Is it possible to make a movieclip of the main timeline, that keeps the layers and frames as they were?
Any hints, much appreciated
p.s.
I'm using Flash8
View Replies !
View Related
GotoAndStop At The The Root Of The Timeline
HI
I have a movie clip with onRollOver and onRollOut script attached. When clicked I would like the root of the timeline to move to a different label. At present I have tried the following first script on the MC to move the root timeline, however this is not working and I assume this is due to the complexity of the movie clip:
I have therefore used the following 2nd script for the first frame of the timeline within the MC which works with getURL but I am unable to get it to work with moving the root of the timeline. Do I need to add .root somewhere? Thanks
Attach Code
On the MC:
on (release) {
gotoAndStop ("event1");
}
Firtst frame of timeline within the MC:
this.onRelease = function(){
gotoAndStop ("event1");
}
View Replies !
View Related
How Do I Control Root Timeline?
Hi flash experts,
i have encounterd a problem with an external swf that i externally loaded to the main movie/root timeline.
what i'm trying to achieve is quite simple. i want to be able to click on one of the butttons in the loaded swf to controll the root timeline. here is the actionscript i'm using but it didn't do anything. i'm using frame lables.
on (release) {
_parent.gotoAndStop("none");
}
am i missing something?
cheers,
samboy
View Replies !
View Related
Referencing Root Timeline From Within A Mc
Hi,
This is probably a really simple question....
I have a root timeline in which contains a movie clip on a certain frame.
Inside that movieclip, on it's second frame, there is a button.
I would like to use this button, when clicked, to move take the user to a frame on the root timeline.
Anyone know the how to do this.
Peace to all mankind.
View Replies !
View Related
Referencing The Root Timeline
Ok, so my problem stems from my dependence on the _root object in AS2.0
If I have a movieclip that I want to call a function that is on the main timeline, which reference would I use? I tried root.testFunc() to call said function, but got no play.
Any ideas?
View Replies !
View Related
How To Control Root Timeline?
Hi flash experts,
i have encounterd a problem with an external swf that i externally loaded to the main movie/root timeline.
what i'm trying to achieve is quite simple. i want to be able to click on one of the butttons in the loaded swf to controll the root timeline. here is the actionscript i'm using but it didn't do anything. i'm using frame lables.
on (release) {
_parent.gotoAndStop("none");
}
am i missing something?
cheers,
samboy
View Replies !
View Related
Accessing The Root Timeline.
Hello,
I have a set of buttons that are contained within a movieclip and all I simply want to do it to tell flash to go to a frame on the root time line when a button is pressed.
However, flash will not accept the code (or variations I have tried) as follows:
on (release) {
_root.gotoAndPlay("10");
}
However, this doesn't work and the output window kindly tells me that: "Statement must appear within on handler
_root.onRelease"
Being new i'm not sure what that means!
Anyhelp appreciated - I'm sure it's simple!
Thanks.
View Replies !
View Related
Help W/controlling Movieclip From Root Timeline
I would appreciate any help on the following:
I am trying to control the animation of a movieclip from the root timeline but not getting the expected results.
Root timeline has single frame and two layers.
First layer is for the actions and the second layer for the movieclip (instance name is baller) itself. Root timeline has the following code:
stop()
baller.gotoAndPlay (2)
The movieclip (baller) has 30 frames and 2 layers. First layer is for actions and the second layer has a simple animation which moves an object from point a to b.
Animation starts on the second frame and continues to the 3oth frame.
First frame of the actions layer of the movieclip has the following code
this.stop()
and the last frame has
this.gotoAndPlay (2)
What I was expecting was that the root should start the movieclips animation from frame 2 and continue to play.
What happens is that movieclips timeline advances to frame 2 and just stops. I also made sure that action layer's frames between 1 and 30 are empty key frames.
I realize that there are other ways of doing this but I need to use this approach for more complex animation if it works.
Thanks in advance for anyone offering some ideas.
View Replies !
View Related
How To Play Root Timeline From Button.
sorry..simple question..waiting for my new MX books to come.
How do I play a the .root movie from a button deep inside two movie clips.
i have a hidden button on a graphic..and i want to do the on mouse click. play . root movie.
any flash MX tutorials links on this would be great.
also what is up with the with tag is that the new way to reference a movie clip on stage.
Can you not use the alt + F3 movie explorer to choose which movie clip you want to target when doing a button actionscripting properties..
thanks for your time and energy.
Ryan
View Replies !
View Related
Need To Detect Child MC's On Root Timeline
I have a control panel loaded into level98, and content on level1. My pause button on my control panel stops the root timeline on level1, but sometimes level1 will have other mc's. Is there a way to tell all the child mc's of a timeline to also stop and play, without knowing all of their instance names (it varies from topic to topic) or them not having been created to attachMovie or duplicateMovieClip?
View Replies !
View Related
Change Root Timeline From MC Using Variable
(this is a flash 5 question)
i'm going to post the .fla because it is easier than trying to explain everything in detail.
basically i have two images on the root timeline.
i have two blank MC's constantly running, the last frame of each changes a variable.
this variable controls whether the root timeline displays the first image or the second image.
the code works in my head, but when run it just sits on the first image and does not change. i have a blank first frame so that the controlling variable is set once at the beginning but thereafter is set by the MC's.
many thanks in advance
View Replies !
View Related
Controlling Root Timeline With MovieClip
I load an external movieClip into a blank movieClip and then I also have a stop on the root timeline. After the loaded movieClip is finished playing I want to move to the next frame on the root timeline.
I've tried _root.play(); and play(); on the last frame of my loaded movieClip but the root timeline wont advance.
I've also tried _root.gotoAndPlay as well as gotoAndPlay.
Can anyone direct me to a tutorial that explains controlling the root timeline with ActionScript from within a loaded movieClip?
I have no trouble using a loaded movieClip to load other movieClips on to the root timeline but I can't get it to stop and go. HELP!!!
View Replies !
View Related
Playing Root Timeline Across Movies
I have two swf files.
Main.swf is displayed which loads home.swf. Home has a close button with the following code:
Code:
on (release) {
unloadMovie("_root.loadInTo");
//_root.main2.gotoAndPlay(1);
gotoAndPlay("_root.main2");
}
it unloads itself fine (as i see it disappear) however i cannot then play the main timeline. (everything is contained in a movieclip called "main2" - so i was trying to play that.)
thanks.
View Replies !
View Related
Targeting Root Timeline From A Movieclip
I have a seemingly very simple question but cant get things to work.
I have a simple movie with 2 scenes;
Scene 1
Scene 2
I have a movieclip on scene 1. Inside the mc is a button. On the button I have the following action;
on (release) {
_root.gotoAndPlay("Scene 2", 1);
}
I expect the button to control the root timeline and goto scene 2.
Any idea why this is not working for me?
thanks,
ab
View Replies !
View Related
Accessing Variables On The Root Timeline?
I have some variables declared on the root timeline that I need to access from some MovieClips. In AS2 I would do something like this _parent.myVar from within my MovieClip. I intend on getting fully up to speed with AS3 but right now I need a quick fix. Help anyone?
on the root timeline I have a variable : var myHitTest:Boolean = false;
My MovieClip needs to access this var so I tried it several ways listed here. I've had no success.
parent.myHitTest:Boolean
root.myHitTest:Boolean
Stage.myHitTest:Boolean
stage.myHitTest:Boolean
parent.myHitTest
root.myHitTest
Stage.myHitTest
stage.myHitTest
(parent as MovieClip).myHitTest:Boolean
(root as MovieClip).myHitTest:Boolean
Stage.myHitTest:Boolean
stage.myHitTest:Boolean
View Replies !
View Related
Reffering To Code In The Root Timeline
I'm very suprised I theres not an obvious answer to this question to be found. In AS 2 I would often write most of my code in the main timeline, and then refer to it from various other movies etc. I dont seem to be able to do that in AS 3? how can I do it in AS 3?
For example if i had a function on the main timeline, and wanted to call it from the code in another movie. In that past I would have just used _root.functionName();
View Replies !
View Related
Reffering To Code In Root Timeline
I'm very suprised I theres not an obvious answer to this question to be found. In AS 2 I would often write most of my code in the main timeline, and then refer to it from various other movies etc. I dont seem to be able to do that in AS 3? how can I do it in AS 3?
For example if i had a function on the main timeline, and wanted to call it from the code in another movie. In that past I would have just used _root.functionName();
RESPONCE:
_root in AS3 is now simply root (no underscore). The root property,
however, is only available to DisplayObject instances, not other classes.
The root reference is also null unless the DisplayObject instance is a child
of a display list attached to the stage. For timeline scripts within a Flash
FLA, however, where the movie clip is added to the screen within the Flash
environment, root is always available.
A good practice for globally accessible functions, however, would be to
define your functions as static methods in a class. Then you can reference
those functions anywhere from any object (even non DisplayObject instances)
using ClassName.functionName()
RESPONCE:
Ummm... I named my document class main, thinking that might help me refer to it from child clips, but it didnt. Using root seems to refer to main, but then I cant refer to anything on the stage, or any function written there. From reading the help I got the impression that function defined in the root timeline would become publicly accessable functions that could be accessed with dot notation. Is this not the case?
When I trace root, or main, it outputs [object main]. So then thats the class... Why cant I refer to the functions of that class from another movie?
Are you suggesting I write a document class with my functions in it? could I still refer to objects on the stage if I do that. I've read over these subjects alot in the documentation and its really not clear... perhaps someone could write a tutorial.
View Replies !
View Related
Can't Reach MC From Actionscript (from A Root Timeline)
Hi!
I'll try to explain step by step:
1) On the main (root) timeline I have MovieClip "base_mc" (instance name
"base_mc") , but inside that
MC "base_mc" I have another MC called "insideBase_mc" (instance name
"insideBase_mc").
2) On the main (root) timeline I have ActionScript:
insideBase_mc._alpha = 50;
but it's not working. All I can do is set alpha for "base_mc".
Can anyone help me to understand how to reach MC that's in another MC?
Thanks a lot!
View Replies !
View Related
Accessing Root Timeline Button
Hi,
I think this is a fairly basic thing to do, but I can't seem to figure it out. I have a movie clip(mc1) with a button(btn1) and a movie clip(mc2) in it. The button plays this second embedded movie clip(mc2). In this second movie clip(mc2), I have a button(btn2) that, when clicked, I would like to cause the first button(btn1) (on the root timeline) to disappear. Is this possible, and if so, could you help me figure out how to do so?
Thank you,
Brad
EDIT: Just so its easier to visualize, here's a hierarchy of the relevant elements:
mc1
-------btn1
-------mc2
-------------btn2
Edited: 10/30/2008 at 09:49:28 AM by bathkbra000
View Replies !
View Related
Array To Control MCs On The Root Timeline
HI - - - a continuing saga
I have a main timeline thats about 900 frames long. During the course of this 900 frames I bring in short MCs (subA, subB, subC, etc) on their own layer which play their duration - (a 90 frame sub MC gets 90 frames on the main timeline).
Using a mc I made into a play/pause btn, I can pause and resume play of the main timeline by targeting “_root”.
I can also use the same button to pause/play the sub_mcs IF I list each one at the pause and play commands. I thought an array would help me avoid that code repetition but it doesn't work.
Can someone look at my code and let me know what's missing and/or what I did wrong?
TIA
JL
Attach Code
var allSubMCs:Array = new Array("sub1_mc", "sub2_mc", "sub3_mc");
playPause_btn.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop("pauseOver");
}
else {
this.gotoAndStop("playOver");
}
}
playPause_btn.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop("pause");
}
else {
this.gotoAndStop("play");
}
}
playPause_btn.onRelease = function() {
if(this._currentframe == 10) {
this.gotoAndStop("playOver");
_root.sub1_mc.stop(); // naming each sub mc does
//_root.allSubMCs.stop(); // the array doesn't work
_root.stop();
}
else {
this.gotoAndStop("pauseOver");
//_root.allSubMCs.play(); // the array doesn't work
_root.sub1_mc.play(); // naming each sub mc does
_root.play();
}
}
//------END PlayPause TOGGLE--------
View Replies !
View Related
Hittest From Root Timeline Problem
this is my code:
if (_root.crosshare_mc.hitBox_mc.hitTest(_root.tree_m c.bird_mc)){
trace("over bird")
}
This is on frame 1 in the root timeline. I'm trying to detect a hit test between 2 movie clips, the crosshare_mc is being dragged, with the hitBox_mc being a smaller movieclip inside it.
The other movieclip is tree_mc with bird_mc being inside it.
I cannot get a hittest, can anyonr help me???
View Replies !
View Related
Pause Root Timeline - External SWF
Hi peeps, I'm having a problem with an externally loaded SWF, more specifically the temporary pausing of the playback head in the timeline within it.
My main movie consists of about 10 scenes each with 200+ frames of tweened animation and general info presentation. If the user walks off and doesn't move the mouse for a period of time then the presentation switches to auto-mode and loads the external SWF using this code:
// moves to a blank scene so as to keep background tasteful.
var userActive:Boolean = false;
var activeIntervalID:Number;
this.onMouseMove = function():Void {
userActive = true;
}
function noActivity():Void {
gotoAndStop("blank", 1);
loadMovie("fscommand/auto.swf", 1);
}
function activeTest():Void {
if(userActive) {
userActive = false;
} else {
noActivity();
}
}
activeIntervalID = setInterval(activeTest, 10000);
- - - - - - - - -
So far, so good. it works fine to this point, and the external SWF loads A-Okay.
The auto mode is a SWF of the same 10 scenes but instead of button clicks triggering a progression through the presentation, I have a script on the relevant frames to hold the playback head for a few seconds, then the playhead continues onwards through the slides of info. This 'pausing' code is a frame script as follows:
_root.pauseCount = 0;
function pause(pc) {
if(_root.pauseCount == pc) {
clearInterval(pauseInt);
play();
trace("fishy!");
}
else {
_root.pauseCount++;
}
}
pauseInt = setInterval(pause, 0, 5000);
stop();
Now the problem. When saving and previewing this auto-mode SWF on it's own, the pausing works correctly, it then continues to play, and the output window displays 'fishy!', but when loaded in through the container presentation the SWF seems to pause for the correct amount of time but then reverts back to frame 1 and loops continuously instead of continuing along the next part of the timeline. No 'fishy!' either.
Yikes! Why is this? Help seriously appreciated.
Thanks in advance, alan-can.
View Replies !
View Related
Accessing Functions On The Root Timeline
What I have is a movieclip that is nested within a movieclip on my main stage.
My question is, is there a way that I can access a function that is written on my root stage from within that movieclip?
In AS2 all you had to do was something like
Code:
_root.myFunction();
And that was it. Not the case in 3.0??
Is there a quick solution?
-Carmire
View Replies !
View Related
Root Timeline Actionscript Problem
Hi Guys n' Girls
I'm having some trouble with some basic script that I've used successfully lots of times before. I have some movieclip 'buttons' embedded within a movieclip that is placed on the main timeline. I have added the following script to the timeline within the movieclip that contains the other buttons
button1_mc.onRelease = function(){
_root.gotoAndStop(3);
}
button2_mc.onRelease = function(){
_root.gotoAndStop(4);
}
button3_mc.onRelease = function(){
_root.gotoAndStop(5);
}
etc... At the moment I have no other script on the root timeline other than stop(); on the relevant frames. For some reason each button will work once and goes to the relevant frame, but once I try and press the buttons they stop functioning and will not let me go to any other frames. There is some code within each specific button
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}
this.onRollOut = function(){
rewind = true; //set or rewind switch to true so it will play backwards...
}
this.onRelease = function(){
if (_parent._root._currentframe==2)
this.gotoAndStop(10);
}
this tells the buttons/ movieclips to do various things. I am wondering if this embedded script is interfering with the script in the parent file containing the buttons somehow? Any suggestions would be much appreciated! Even if it's to help me tidy my script up.
thanks!
View Replies !
View Related
After Loading A Movie How I Get Back To The Root Timeline
situation
1. On the main timeline there's a main menu, with the label "menu"
2. I choose a button from the menu which loads a swf
using the loadMovieNum ("help.swf" , 1);
3. Now the "help.swf" has a mc called: help_i_don't_know_MC_.
4.This MC has a button which loads another swf into the same level : loadMovieNum ("helper.swf" , 1);
5. I have used this code
on(release) {unloadMovieNum (1)
_root.gotoAndPlay("menu" )
; }
please help
View Replies !
View Related
Question About Root Timeline Frame Number
I am building a movie where there are multiple scenes. I built each scene's movieclip's actionscript around that scene's timeline (refrenced as _root), starting at 1. When i test the scenes, this works fine, because the scene's current frame and the _root._currentframe are equal. But when i test the movie, any actionscript that refrences _root._currentframe outside the first scene executes improperly, since (as i just learned) the _root._currentframe dosent reset at each scene. I tried substituting "_parent._currentframe" for "_root._currentframe", but the same thing happens. So, my questions: Is there a way to have flash reset the _root._currentframe to 1 at each scene? Is there a way I can access some sort of "_scene._currentframe" kind of thing? If not, what should i do? A possible solution is for me to just figure out the _root._currentframe value at frame 1 of each scene, and adjust all my actionscript accordingly, but im sure theres an easier way. anyone have any ideas? thanks
View Replies !
View Related
Button Inside An Mc To Control The Root Timeline?
Ok, how do I make a button inside an movieclip on the main timeline successfully gotoAndPlay on the main root timeline that holds rthe ms where the button is contained. I want the button in the mc to play the root timeline of the whole flash movie with a
gotoAndPlay("scene",1);
my_btn._parent is:
level0.myMovieClip
but my_btn._parent.goto...
and my_btn._root.goto...
both do not work?
Any ideas?
View Replies !
View Related
|