-
Layer above actionScript
How do you place a layer above actionscript? In my experience any graphics from a movie clip or button etc called by actionscript are visible above the highest layer in the timeline. What am I doing wrong?
Thankyouuuuuu
-
addChild adds to the top of whatever container is being added to. The default behavior from frame code is therefor to add the new instances at the top of the root. But you could create a container at another layer and add to that instead. Or you could use addChildAt to add to a lower level without an organizing container.
-
sorry I'm a bit of a beginner. What exactly is a container? do you know of any tutorials?
thanks again
-
By container, I meant any DisplayObjectContainer. That is, any Sprite or MovieClip, usually with no appearance of its own. If you had such a clip on stage named "container", you could add a new child to it by calling its addChild method.
Code:
container.addChild(thingy);
-
DisplayObjectContainer
So does all the content I have at present have to go into a DisplayObjectContainer and then the graphic I want to appear above this needs to be in addChild?
-
You don't have to re-arrange all your current stuff, you just need to understand the display list, which is actually a tree.
Each DisplayObject on the display list is a child of another DisplayObjectContainer, all the way up to the stage. Each DisplayObjectContainer (MovieClip or Sprite) can have multiple children. Direct siblings are shown from bottom to top in their child order. If A is on top of B, all children of A will be on top of B and all children of B.
So if you want to add children dynamically at a particular relative level, create an empty movieclip at that level, and add your children to that.
-
I'm afraid I'm still confused. I'm trying to get the clouds and rain words to disappear behind the grey block and the white frame. This is the file so far:
http://www.financial-angels.net/images/banner.fla
Thanks for your time, much appreciated!
-
Hi I was just browsing around here because I am lost as well but I really like how you set up your site and that dayng debt was following eme on your site and was irritating...lol good job and very imaginative.
-
container.addChild(thingy);
what would (thingy) be?
sorry I am very new at this
-
thingy in that example code is any DisplayObject which you would like to be a child of the container.
-
I had a similar problem recently and this will help me as well. I can't wait to try it. What I think 5Tons is saying Skippers, is to create a new movieclip in AS.
var mc2HoldButtons:Movieclip = new MovieClip();
addChild(mc2HoldButtons);
am I close 5Tons?
how do you tell it to add the buttons?
OR maybe you can just use a MC already created and use addChild(the name of one of the buttons) or addChildAt.
Last edited by christylove; 03-21-2010 at 10:48 AM.
Reason: trying to figure this out...lol
-
If I was to have an invisible button above everything I wouldn't want the cursor to change to a hand unless it was over a real button
-
As 5TonsOfFlax is trying to say you need to use a DisplayObjectContainer.
I will try and give you an example.
Create two layers:
1st layer (Top layer) Holds all your text you used in the GUI.
2nd layer (Bottom) holds a MovieClip that you will use as a container.
Open the actions and use addChild() to add a button or movieclip to the 2nd layers MovieClip and you will see that the text is over the movieclip, so the movieclip and children are not overlapping the text.
Hopefully you can understand that :P.
-Alex
-
I'm thinking what I need is an animation that disappears once the mouse hovers the stage, which then activates the words raining from the clouds (these will be hidden originally)
Then once the mouse moves close to the click for help button anther animation activates.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|