ActionScript 3.0 :: Using The Time Line And The DisplayList - DL Keeps Duplicating Stuff
May 7, 2010
Iv'e been slowly moving over to AS3 in the past few months and I think I have learnt quite a considerable amout. However I am completly dumbstruck by the behaviour of the DisplayList. The kind of work I do requuires that the flash movies I make are timeline based (I know spitting in the face of OOP) because of the amount of animation used. However within these animations I also use snippets of ActionScript to have interactive moments such as drag and drops or tabs for the user to select a section. Now in these cases I as you would expect have to redepth some stuff (like the currently active panel of some tabs or currently active drag item etc). Using the display list I think is dead easy and I actually prefer it to the old Depth based system of ActionScript 2. This is where the odd problem starts.
On my stage I have 2 insences of the same MovieClip ("Clock1" and "Clock2") which has a child named "hand", also I have 2 text boxes just to dictate which movie is which. These clips and text are nothing special just author created in flash so no code involved for adding them to the display list.
[Code]...
View 2 Replies
Similar Posts:
Mar 25, 2010
My issue is that for my website I want there to be movies in between the interactive parts of it where the interfaces slide in and out. However, I can't stop a movie from playing over and over instead of playing once and going to the next frame.With 2.0 I haven't been able to find any research that helps me, probably because I don't know the correct keywords to search for.Right now I have my main time line set up with a loading bar on frames 1 & 2, that then jumps to frame 3 where I have embedded a movie (Instance named: mc_start) of the interface sliding in. Preferably after that I need it to jump to frame 4 where the actual interface is.
I can get the movie to end by going into the embedded movie's time line and simply have stop() ; at the final frame, but I can't get it to go to frame 4 on the main time line. If I having something like gotoAndPlay(4) ; on the final frame of the embedded movie's time line, it simply goes to frame 4 of the embedded time line and not frame 4 of the main time line. If there was a command to make it jump back to the main time line instead of the embedded time line, that would work perfectly.Coding on Frame 3 of the main time line to jump to Frame 4 would work if I knew the correct language to detect when the movie has ended (Movie is 191 frames long), so that afterwards it would immediately jump to Frame 4, but I haven't been able to find any resources that will teach me how to do it. Right now having gotoAndPlay(4) ; on Frame 3 of the main time line obviously makes it immediately skip the movie on Frame 3 and jump to Frame 4.
View 2 Replies
May 15, 2011
What I have is a movieclip and a button in scene 1 (which is the main timeline).There is an actionscript layer also on the main timeline. what I want to do is when I click the button, it would do a nextFrame(); in the movieclip timeline instead of the main timeline.
View 4 Replies
Aug 24, 2009
Currently I have a function that makes a movieclip copied from one specified in the GUI,moves it to a certain point on the stage, then ends. This is called several times to create various patterns etc on the stage.
Code shown below:Code:
function draw_block( iX, iY , sBlockName )
{
[code]....
View 11 Replies
Jun 29, 2011
So what I'm looking to do now is to actually get that movie clip - in this case an arrow -to rotate around another object - a ship - at a radius of 150 pixels and facing the mouse.This basically means to get the arrow to follow where the mouse goes around the ship - limited by the 150 pixel radius circle it can follow.p.s. This is the code so far:
ActionScript Code:
theArrow.x = theShip.x
theArrow.y = theShip.y
[code].....
View 4 Replies
Feb 15, 2011
I have a time line of 1441 frames my frameRate is 24 fps so it takes 1 minute exactly to complete the timeline animation I want to Display the Remaining time as file starts I need formula to place in ENTER_FRAME event which displays the time left
View 2 Replies
Feb 15, 2011
I have a time line of 1441 framesmy frameRate is 24 fpsso it takes 1 minute exactly to complete the timeline animationI want to Display the Remaining time as file startsI need formula to place in ENTER_FRAME event which displays the time left
View 1 Replies
Nov 16, 2005
i want to duplicate a line 4 times, and move each line on Yaxis, with a delay of 1sec each time. I know i must use setinterval+duplicateMovieClip, but i've got pbs :-( actually, i've got my AS code on my line :
[Code]...
View 7 Replies
May 26, 2011
I'm trying to use a SWFLoader to load an Application and add the loaded Application to my Displaylist.
public function onComplete(e:Event):void {
someContainer.addChild((e.target.content));
}
[code]......
View 3 Replies
Feb 10, 2009
AS2 on a button symbol:
on (release) {
_root.randomVar = pie
trace (_root.randomVar)[code]..........
If I put Var = X in the time line it comes out undefined, no variables seem to be working, tried it in 2x flash projects
View 8 Replies
May 28, 2009
I am having some trouble understanding the display list. This might sound silly but how long does it take until a sprite is added to the display list?
My understanding is that the root variable is only accessible once the object is added to the display list.In the following code I add the TLSEntry_Text to the display list and then on the next line I try to trace its root variable without luck. The root variable appears only in the enter frame event... I guess a little bit later.
What am I missing here? Is there a way for the display list to "force refresh" itself?
[Code]...
View 5 Replies
Feb 7, 2011
Is there any event dispatched in ANY place of the display list if the order of display list items change?Or is there any other way to track that without manually keeping track of all display list order or needing to override all "setChildIndex" and "swapChildren" functions?
View 2 Replies
Feb 24, 2010
I want to run a sound once in a timeline but want the sound to stop at the end of the first run on the timeline but want the timeline to continue to repeat without the sound running again.
View 3 Replies
Feb 9, 2009
What I mean is, can I add a sound that will only play if there are enough frames for the sound?I want to only play on the frames that it is on, but it plays all the way through the sound file regardless of the amount of frames.
View 0 Replies
Jun 14, 2006
I am wanting to control the timeline of a MC using AS. What I mean is when I click on a movie click and drag right it controls the reverses the MC and when I go left it plays it (but i only want this to happen when I click and drag).
View 7 Replies
Apr 14, 2009
how to return to the main time line from within my movie clip. I thought it was something like _root.gotoAndPlay(4); but all I'm getting is errors.
View 1 Replies
Jun 7, 2004
i dragged an mp3 onto the time line and i want to be able to make it stop with the click of a button,
Code:
on (release) {
Sound.stop(["stap-1.mp3"]);
}
View 3 Replies
Jan 4, 2011
I'm working on a game for the iPhone using flash, and since memory is crucial i want to clean up displayObjects not needed. All the objects i need to delete is MovieClips taken from some array to another using splice(). Here is the [code]...
View 2 Replies
Mar 25, 2011
I'm working on a drag-drop solution, and acting when a item is dropped on the current target (let's say an "intelligent chess-board") is a breeze, as the board fires DragEvents when items are hovering over on dropped on the it.
What I'm looking for is a way to make the board act when an item is dragged OFF the itself. Of course - when the item is dropped somewhere else, I could fire an event there and tell the board that change has been done. But this is what I want to avoid.
I wonder if there is some way to monitor a change in the displaylist of the "board", so it fires an event when a child/element is removed from "outside"?
View 1 Replies
Jul 18, 2009
I am just trying to grasp a simple concept of utilizing loops, addChild, and eventListeners.My goal is to use a loop to create multiple instances of the same type of object from my library (called Ball), and when one is clicked, have it move "above" all other instances on the stage (and eventually drag, but that's easy enough to make happen later).My current code attempt is:
for(var i:uint = 0; i<=10;i++)
{
var my_ball:Ball = new Ball() //new instances of Ball from library export
[code].....
View 2 Replies
Nov 22, 2010
I have one mp3 file in the time line. How to controle set volume
View 1 Replies
Jan 25, 2012
I have learned from a video tutorial (Flash CS5 in the Family 23: Banner Ad Part 1)to use the F5 key to set the length of a time line of a particular image.When using the F5 key on the MAC keyboard, it will only allow for the audio to be worked with.I've tried Apple+F5, Option+F5, Ctrl+F5 etc.What am I missing?
View 1 Replies
Mar 26, 2012
I'm using this action for specific keys to simply advance the time line -
on(keyPress "<Space>"){
play();
}
what if I want to use all the keys of the keyboard to control this action ? Is the group selector to use ? Like "all keyboard" "all keys"?
I have got AS3 code to do it -
stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);
function fl_KeyboardDownHandler(event:KeyboardEvent):void {
gotoAndPlay(currentFrame+1);
}
But wanted it for AS2 ?
View 3 Replies
Sep 25, 2009
I am trying to link a button via AS but I need to use a function that is on a different time line for it to work. I have no idea how I am going to do.
[Code]...
I am trying to use the "var flvControl" but that function is located on a different timeline.
View 7 Replies
Feb 15, 2010
I am building a Flash continuous play application for a company to use in a booth presentation at a sales show. In effect, it will be a more engaging Powerpoint presentation. Each slide will be a be a frame that will call an external swf into movie clip with the animation of text or fade in images in the external swf. Each external swf will stay on for about 10 seconds. I am looking for an action script that will first stop the advancement at each frame for 10 seconds (ability to edit seconds needed) and then move to the next frame and stop for 10 seconds then the next and so on and so on and at the end, start back at frame 1.
View 1 Replies
Jun 25, 2011
I am making a small project and i want to know how to get flash to change from one time line to the next , i am thinking of using an if statement to check if an object had passed the top of the stage and if that condition is true then i want it to go to the next layer on a different frame to play another animation?
View 4 Replies
Oct 3, 2011
I want to write a function on timeline whose arguments I want code to read from a xml file.
View 2 Replies
Apr 27, 2009
i am trying to play the timeline backwards once it reaches the end, but i cannot fine anything out on the net to explain how to do this without a button click.
View 1 Replies
Feb 21, 2009
i read this tutorial, it is about how to control the time line of the loaded swf
[URL]
but i get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at main_fla::MainTimeline/frame1()
[Code]....
View 4 Replies
Nov 15, 2009
How do i refer back to a dynamic text box on the main stage?
View 1 Replies