Flash - Nested Animated Symbols With Child Longer Than Parent?
Jan 12, 2012
I'm looking to create an animation loop in Flash. The base character animation I have is 27 frames. However to have the background move at the correct speed, the entire animation is 432 frames.
Since I am making the animation so long anyway, I want the character to blink halfway through the animation loop. I went into the head symbol and extended its animation from a single frame to 432 frames. Halfway through that animation I swap out the image for one that is blinking (3 new images added for the blink).
So, now the symbols are nested like: 432 frames -> 27 frames -> 432 frames
But it doesn't seem like Flash is smart enough to animate it as I would expect. It only repeats the first 27 frames of the child symbol.
The next thing I tried was extending the 27 frame character animation out to 432 frames. I did this by copy-pasting the character animation 16 times. But this also does not work because copying the keyframes also copies the position of the child animation's playback. This causes the animation to constantly reset and never reach the blink.
I also tried using the copy motion option, but it didn't seem to do anything different than copying keyframes.Is there an easy way to make this animation work? I can't possibly need to manually position a total of 576 keyframes (there is actually another level to the nesting which does not use any tweens, just keyframes) could I?
View 1 Replies
Similar Posts:
Oct 26, 2010
I'm working through a book called Foundation Game Design with Flash, and I'm finding the Flash IDE confusing. I've been programming for several years, so working with AS3 directly is far easier than trying to understand symbols and nested symbols and the difference between graphics and movie clips and scoping issues and all that -- when tied into the IDE.
How many of you who are making games in AS3 also use the Flash IDE? Can anyone recommend a resource that is AS3 heavy and Flash IDE light? I don't care how much time I may or may not save by using things like the timeline, I just want to understand what I'm using.
View 9 Replies
Jul 18, 2010
I'm switching from as2 to as3 and everything was going swimmingly with my new site until i tried to use a _root call to a function on the main timeline by a loaded movieClip that is loaded nested into 2 other movieclips. the movieClip needs to tell the _root when it's done playing so the root knows to load the next one in line through a php call. Everything works except for the _root call. In as3 there's no such thing as root anymore so I figured no big deal, i'll just find out what the new thing is and holy crap wtf! I can't figure this out!! I've read from doing stuff like custom eventLisnters (which i am trying now) and casting the root as a movieClip and then I read this whole crazy tutorial on building an event structure and the proper MVC way of coding and blah blah blah ALL I WANT TO DO is tell the _root that the loaded MC has reached the end of its timeline. Basically if it were as2 i could just go _root.loadNext(); and it would work.how to make a loaded MC talk to the _root timeline and call a funciton from there?
View 19 Replies
Dec 2, 2011
I have a very specific AS2 parent/child movie clip issue. I have a main Character movie clip which contains as nested frames each profile of the Character (front,back,left,etc). Within each of these child profile MC frames, animations for those profiles are further nested in frames. Then, essentially I have movement code as part of the key listener:
Code:
switch(Key.getCode()){
case 87:
Character._y -= 10;
Character.gotoAndStop('Back');
Character.gotoAndStop('walk');
break;
[Code] .....
And later code to reset to the character's resting frame after key release:
Code:
switch(Character._currentFrame){
case 5:
Character.gotoAndStop('Back');
break;
[Code] .....
The problem is that when I try to Character.gotoAndStop('Front'); after key release, flash thinks, you're already on the Front frame (because the walk animation is a child of that MC and is already playing). Therefore the walk animation just keeps playing after the key has been released.
View 1 Replies
Jun 2, 2011
I have been using:
yourbutton.addEventListener(MouseEvent.CLICK,f);
function f(e:Event):void{
Loader(this.parent).load(new URLRequest("newswf.swf"));
}
which was suggested to me in a different post to target the parent loader class, however i now no longer can reference my preloader in the parent swf (extract from the parent swf):
[Code]...
View 5 Replies
Jul 29, 2011
I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.
View 10 Replies
Jun 6, 2011
i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).
View 5 Replies
Jul 29, 2011
I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.
When Sprite2 is NOT rotated:
Code:
trace(SpriteP.width + ' ' + SpriteP.height); //100 250.
SpriteP.removeChild(Sprite2)
trace(SpriteP.width + ' ' + SpriteP.height); //100 200. -> works, 200 is good.
When Sprite2 is rotated at 90:
[Code].....
And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200. But if I rotate Sprite2, the Parent won't update its bounds.
View 1 Replies
Feb 5, 2010
[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]
View 2 Replies
Aug 24, 2010
I am trying to make a calculator where a user can select from a list of items. If a user clicks say "ITEM1", it should add the item to a "CONTAINER_MC". The problem i have is all my data is set inside an array containing names and prices like the code below.
[Code]...
View 1 Replies
Oct 6, 2010
Here is a working script to drag drop a ball from the stage into another target mc:
ball.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void{ [code]...
It works well but I'm new to AS3 and I am having difficulty amending this script to drag the ball out of a parent mc (instead of the stage) and onto another mc (the target mc). To explain: imagine a ball, a box, a tri, + more shapes all within a scrolling mc (initial parent), the user scrolls to select a shape, then drag-drops onto a target mc on the stage.The scrolling is no problem, but how would you amend the script above so that the ball can start inside a parent mc rather than on the stage itself?
View 2 Replies
May 28, 2010
I am stumped as to how to use an animated symbol repeatedly in a timeline while being able to alter its visual qualities without breaking the animation motion.I make a simple 3-layer animation of a body with two legs doing a walk cycle in place.I convert the completed animation as a new graphic symbol in the library.
I can then drag copies of that animated symbol to different timeline layers and alter their overall scales or give them each additional motions with a motion tween so various versions of it can move across the stage independently with tweens while keeping the walk cycle movements of the symbol.
I can change the colour properties of the added symbols but this only affects the whole image, so if the object had a body and legs in different colours, altering the properties changes all of the body parts to the same colour.Doing this does preserve the walk cycle motion, but the new object looks crude because it has become all one colour.I can then alter the visual properties of the components individually, but then it loses its animation motion.Whether I just group it again or convert it to a new symbol, it has lost the animation motion (the walk cycle of the legs) of the original. how to make such an animated symbol so that I can reuse it in the timeline while changing its visual properties (so it looks like a different character in the story) and yet keep its original animation motion.I have tried to duplicate the symbol and to copy and paste the motion but nothing seems to work.
View 1 Replies
Aug 5, 2011
FLASH CS5 using Windows XP. I have created an animation that I want to export to sequence of .png files. The file has Symbols that contain embedded animations.
For instance, I have a flashing light in one Symbol. That is embedded in a bouncing police car Symbol. The police car Symbol (with the embedded flashing light) is brought onto a flat bed truck at the "scene" level which is driving down a road. It all looks nice if I render an internal swf file. However, when I export the individual frames, all that is rendered is the flat bed moving down the road. The bouncing car and the flashing light are there but without the animation of each.
how to export an animated sequence that include the animations embedded in its Symbols?
View 4 Replies
Jan 3, 2010
I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()
View 1 Replies
Mar 2, 2012
I have created this madly complex menu rollout with buttons, tweens lables with dynamic text- you name it.now I want to duplicte this symbol and change its colour to make a new menu tab, but when I try to do this (by going into it and duplicating each nested part- I am getting a linkage error-**Warning** The linkage identifier 'Symbol1' was already assigned to the symbol 'Symbol 2', and cannot be assigned to the symbol 'Symbol 1', since linkage identifiers must be unique.
View 3 Replies
Sep 11, 2010
if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child?
In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.
If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.
View 29 Replies
Nov 11, 2009
I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.
I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.
View 2 Replies
Nov 2, 2009
Let's say I have Class Holder linked to a MovieClip holder_mc. holder_mc has a child held_mc that has a Graphic Symbol pic_gr. pic_gr has multiple frames.
From the Class file of Holder, how would I change the frame of pic_gr? I also didn't see a way to name the instance of pic_gr, is that right?
View 1 Replies
Nov 2, 2009
Let's say I have Class Holder linked to a MovieClip holder_mc. holder_mc has a child held_mc that has a Graphic Symbol pic_gr. pic_gr has multiple frames.
From the Class file of Holder, how would I change the frame of pic_gr? I also didn't see a way to name the instance of pic_gr, is that right?
View 0 Replies
Jan 21, 2011
I'll give a complete explanation of what I'm trying to do. I have a video player as a separate SWF. In this video player I have a VideoContainer class extending Sprite, which contains the video and a control bar with specific video buttons.
This SWF is loaded in another main SWF, which has a menu that is on top of everything else. When I click "Fullscreen" in the video SWF, everything goes smoothly, except the menu remains on top of the VideoContainer object.
I need a way to change the display order of the loaded SWF, to put it on top of everything else on Fullscreen and change it back when Fullscreen goes off. All this needs to be made inside the video player. Also, the configuration of the children can change (the video player can be loaded in different places in the main SWF), so I can't use a certain unchanging path.
View 2 Replies
Sep 29, 2011
trying to on mouse over set the parent of the moused over text field to the highest depth child of its parent i tried both of these: [code] private function
[Code]...
View 3 Replies
Nov 7, 2011
i want to pass the variable from parent to child .How Can i pass the Variable.Here i paste my code.
My Parent Class
public class PlayerStrobe_domaincheck extends Sprite
{
private var myService:NetConnection = new NetConnection();
private var _loader:Loader;
[Code]....
View 3 Replies
Aug 21, 2010
I have an issue where removechild won't infact remove a child. I think its something to do with my dropTarget.parent issues. The concept of the code is that you drag a source onto a destination. When you drop the source onto the destination you will get a text field that says "Hello" or "Goodbye". The objective i want to achive is that once i drop a source onto the destination, removechild will remove any previouse textfields added. This is proving difficult.
[Code].....
View 3 Replies
Feb 29, 2012
How do I do this? Inside the parent swf myVar value is set by query string value loaded in by swfobject var myVar = _level0.part; // i have the value 123 here ..all good so far
[Code]...
Always childLog.text is undefined :( - so how to access the value of myvar from the child?
View 1 Replies
Oct 30, 2010
I am working on a component framework for myself right now, and was wondering if a child component should contain a reference to its parent. Obviously flash itself does this as part of the movieclip parent/child structure, so I figure it's okay to do this, but does this present any memory problems or anything, having references to the parent in the child? Would it be better to do some sort of lookup tree, just passing each child an array of GUIDs or similar which I could use to trace a component back to all its parents?
View 14 Replies
Apr 14, 2010
I'm new to flash and don't know if it's even possible. I'm trying to cache animations using mc.gotoAndStop(frame) and bitmapData.draw(mc,matrix). This works perfectly for movieclips that doesn't contain any nested movielclip animations. When I have nested movieclips, only the 1'st frame of nested clip gets drawn. Is it possible draw moviclips with nested animations?
View 3 Replies
Aug 12, 2010
set text property of textfields nested in clips on an animated timelines.
All assets are named from the first frame of the outer movieclip. Debugging this in Flash Builder, we can see that the textfield property is being set, but probably because of the multiple keyframes within the outer movieclip AND inner movieclip, there is some confusion occurring...
Testing various scenarios with nested animated movieclips, and nested NON-animated movieclips, the results are this:
It works in this scenario:
mcMainContainer(with animated timeline)>mcSubContainer(with no timeline)>myTextfield
But as soon as we have a nested animated timeline, like this:
mcMainContainer(with animated timeline)>mcSubContainer(with animated timeline)>myTextfield
...we lose the ability to assign dynamic text to the nested textfield.
View 1 Replies
Sep 22, 2011
How can I access a movie clip's children (specifically child movie clips) in jsfl? [code]...
View 1 Replies
Aug 13, 2011
So i have a situation where i want to pass a object of a class say 'MyBigAwesomeClass' from a child to a parent. I import the class definition into both the parent and child. Now, if i load the child swf from a location that is relative to the location of the parent , all is fine, however the moment i load it using a full absolute path, it treats the definitions for 'BigAwesomeClass' in parent and in child as different and does not allow an object of the type 'BigAwesomeClass' to be assigned to an object of the same in the parent class.I am totally stumped, and have banged my head over ApplicationDomains, including using this code
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfLoaded);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.load(new URLRequest(_file.url),context);
[code].....
View 4 Replies
Oct 14, 2011
I'm trying to access some variables from my parent in my child MC.
Parent code:
var data_history:String;
function finish_checkUp(event:Event):void{
var checkUp_stat:String;
[Code]....
Now as you can see, i have tried the trace method, but with no luck. Flash doesn't report any errors regarding the trace method, but does report the two undefined vars (data_history). Ive tried to use the trace method above all the functions, at the top of the script, still the same errors though.
View 2 Replies