ActionScript 3.0 :: AddChild-Selected Child Always On Top?
Jun 11, 2009
I have a package that scales a pic up when the pic is moused over. Also in the .fla that references that package, I have code that loads the pics into movie clips on the stage(using XML).
My problem is that when I mouse over the pic it goes behind the other pics that are next to it. The moused over pic needs to appear above the surrounding pics. I know this is an addChildAt / indexing issue. I'm just having trouble working it into my code.
Actually, the package code (PhotoScaler.as) has a line that is supposed to make the moused over mc go above everything else, but it doesn't work when I add a pic to the symbol
Here is the Package code:
Code:
package AS3code {
import caurina.transitions.Tweener
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code]....
View 2 Replies
Similar Posts:
Mar 19, 2011
I've used this site as a resource leading up to this, not particularly sure if I worded this correctly I have a class "Block" which is just a square (will be something else later on in the process) I want each block to have controls to add an additional block in either direction so I have another class BlockButtons which has my buttons for each direction.
And another class GlobalVar where I keep all my variables for funsies
[Code]...
View 1 Replies
Mar 10, 2010
var viewStack:ViewStack = new ViewStack();
viewStack.percentWidth = 100;
viewStack.percentHeight = 100;
[Code]....
Its only displaying canVas3 contents not canVas1 and canVas2
View 1 Replies
May 25, 2010
Within the main timeline I have a menu, which is a MovieClip. This menu is comprised of about 17 "buttons", each of which point to a different section of the site. When a "button" is clicked (2 examples: menu_bag_button, menu_trashbag_button), the menu will animate, moving left, and 2 library items (bag_container and close_btn) should appear to the right, both within "framecontainer".Then, while the menu is on the left, this specific button must not repeat the menu animation, thus I did an if statement finding which frame it is on, and if it's on the left, it simply clears the framecontainer and loads the content again.
The problem is that when another link is clicked, it needs to do one of two things: if the menu is in the center with no content loaded, it needs to animate the menu to the right, and load the content/close_btn into "framecontainer"; or, if the menu is on the left, it needs to clear "framecontainer" and load the corresponding content.I've tried a lot of things but since all of these buttons are within "menu_mc", the actionscript has to point to the root, THEN to"framecontainer" and everything gets convoluted.Here is my current code. It functions fine, except for the fact that it doesn't clear content, so it continues loading the frames so that one is closed, there is still other content behind it:
import flash.display.*;
import fl.transitions.*;
import flash.events.MouseEvent;[code].............
View 1 Replies
Sep 30, 2011
I'm working on a spider solitaire game and I need a way to bring cards out of their parent column and on to the main stage when they are selected. Here's my current code:
[Code]...
However, the above gives me an error on the stage.addChild line. "1118: Implicit coercion of a value with static type Object to a possible unrelated type flash.display: DisplayObject."
View 1 Replies
Dec 3, 2009
in main.mxml :
public function init():void
{
PopUpManager.createPopUp(this,login,true);
}
[Code]....
How can i selectchild of main.mxml's Viewstack from login.mxml ?
View 4 Replies
May 27, 2011
I'm transitioning a flex 3 application to flex 4. There was AS code in the flex 3 app that worked:
var myCurrentSelectedChild:String = myViewStack.selectedChild.id;
Now, in flash builder and flex 4.5, it throws the error - "-1119: Access of possibly undefined property id through a reference with static type mx.core:INavigatorContent". I'm trying to get the viewStack's selected child's id.
View 3 Replies
Oct 21, 2008
When i create a new Accordion object and add some items to it with a dataProvider The default selected Child is 0.
View 3 Replies
Dec 16, 2010
Is there a way to access the child of a selected movieClip in JSFL.
ie i can access the selected movieClip using fl.getDocumentDOM().selection[i]. Now i also want to access the child of this movieClip.
My aim is to give instance name to all the movieClip in an FLA
View 1 Replies
Feb 27, 2011
I have an Accordian in my application. Each child of the accordian has a label firstNameLabel) and a button (addPolicyButton). The label's value is being set via Repeater and an array. How can I access the firstNameLabel's value of 'selected child of the accordian' when the addPolicyButton is clicked?In following code testTextArea.appendText prints 'fname: undefined' in the testTextArea.Where as I can see in the accordian that the set label's text is set to 'Michael' which is what repMonitor.currentItem.firstName returned.
Code:
private function addPolicy():void{
testTextArea.appendText("fname:"+firstNameLabel.text);
[code].....
View 1 Replies
Sep 1, 2010
I'm adding various movieclips to the stage with the following code:var invis_obj = new invisible_li_mc();addChild(invis_obj);However, when I try to access the movieclip such asinvis_obj.buttonMode = true;I get nothing however, something like invis_obj.alpha=0; works fine..
View 7 Replies
May 26, 2010
Everywhere I've looked has instructed me to download plugins and addons because they're "superior." I'm just looking for a simple fade in/fade out when a child is added/deleted (if fadein is all I can get, I'll take it.) Here is a function I'm calling...
[Code]...
View 2 Replies
Dec 13, 2009
I am trying to use addChild to create a child movieclip of one created in another Class. It creates one fine in the testCanvas class but when I want to add a child clip with mctestObject I get nothing.
Code:
package
{
import flash.display.MovieClip;
import test.mctestObject;
[Code].....
View 3 Replies
Jul 21, 2009
"TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/addChild()
at newLFXsite_fla::MainTimeline/onClick()"
so i get this error every time i click on the about page after the homepage appears on screen, from what i know im doing everything right, but i guess theres something wrong that i cant see.
[Code]...
View 2 Replies
Oct 5, 2009
My issue is this: When I call MC1.addChild(MC2), it moves MC2 a few pixels from the location it was originally. I don't want it to move MC2,
View 7 Replies
Oct 23, 2009
I am trying to get a circle shape and a text-field sit inside a square sprite, using addChild() method. Both the children seem not to agree sitting in the lap of their parent; and are sitting at a distance, instead. If I create a square symbol on the stage and run the application, everything is fine.
[Code].....
View 3 Replies
Jul 28, 2009
The code below is called after a thumbnail is generated and available. It is supposed to add the thumbnail to a MC along with the file name. The first go around (after a file is uploaded and converted) works, but the second time around the 2nd MC is generated and placed on stage with the correct file name and thumb image, but the first thumbnail image isappears (the file name stays).I don't understand why.
Code:
function initlistener(e:Event):void{
myURLFILE = "myURL";//reset URL
[code]......
View 2 Replies
Mar 31, 2009
The only thing that has me puzzled is the preview field. Basically i have a background which is a movie clip, it basically transforms from the loader to the background (over 70 frames).
is there a way to have the preview field for the root movie display a child movie at a frame other than frame 1? At the moment it looks like this: [URL]
But i'm wanting it to look like this: [URL]
It would help or positioning other items if i had the background displayed how it will actually be?
View 2 Replies
Jan 23, 2009
Using Child Navigation to load main time line.I am new to AS3 and have done pretty well but have been caught up this area.I have been loading swfs into a loader (imageLoader) which has been added to the stage using addChild. Then with buttons and functions I load other swfs into the same loader which replace each other. I now have an swf "testProject3a.swf" loaded into (imageLoader) which has icons for navigation and when each icon is clicked I need it to load another swf into (imageLoader) and replace it's self "testProject3a.swf" with "portalB.swf".I've tried adding removeChild code to the loaded swf but it removes the original (imageLoader) and the other buttons have nothing to load into.[code]
View 3 Replies
Aug 21, 2009
in my last flash website i built, i created a gallery, my way of creating pages in flash are to have a movieclip as a page, so to make it easier to switch between the paged (page switching functionality is purely done in AS3). the gallery was a problem however, i needed the pictures to appear as popups, however to add the child from inside the movieclip, any masks i use would prevent the popup from leaving the immediate area of the page. so to get around this problem i basically used: MovieClip(root).addChild()
in my opinion this was a mistake, because it created other problems. the problem was that the popups are still connected to the page, even though they are outside of it, which meant that using removeChild() to switch from the gallery, meant that any popup that were still active, 'DIDNT' dissapear, and worse than that, because the page was removed, the popups lost any AS connected to them, which meant the couldnt be removed at all.
[Code]...
View 2 Replies
Aug 11, 2011
If im usin function to add a mc to the stage like so:var myChild:MC= new MC();
function somefunc()
{
stage.addChild(myMC)
[code].....
View 4 Replies
May 19, 2010
I have a menu with many sub menus. I need to change the color of the selected button and then move on to the sub menu. My menu is horizontal and now it's not obvious the path that you follow.
View 2 Replies
Nov 6, 2009
Is there any way to disable a few columns for a particular row in flex datagrid?
I have a datagrid with about 10 or more columns, say for example a few column names are: Item Id, Item Name, Item Status and VerifiedState. Initially I want the column Verified State to be disabled.
Now When the value of the column, Item Status is Review Passed for a particular row, I want the column VerifiedState to be enabled and editable. Is that possible in Flex datagrid.
View 2 Replies
Jun 15, 2011
I'm trying to have a class file which can add objects to the stage via addChild; however, when I call addChild from within the class file, I get the error "1180: Call to a possibly undefined method addChild." I've tried importing flash.display.* and that doesn't fix the problem. Does the class file have to extend Sprite or MovieClip to be able to add objects to the stage?
View 8 Replies
Jan 16, 2012
I have downloaded Box2d ([URL]) and created a project that looks like this: [URL]. catalyst is the green cube and it has the base class "shapes.box", it is inside "world" which has the base class "wck.World". What i want to do is to add another "catalyst" from the library inside "world" when i click on add_btn. I tried to accomplish this by this code:
[Code]...
Symbol 'buttons', Layer 'Actions', Frame 1, Line 41061: Call to a possibly undefined method addChild through a reference with static type Class.
View 9 Replies
Jan 20, 2011
I have the followings:
_p:Player (which is a MC)
a1:Animation1 (which is a MC)
_p.addChild(a1); //doesn't display anything
_p.stage.addChild(a1); //displays a1
Why won't the MC display a child without using his stage?
View 1 Replies
Aug 11, 2009
I'm trying to resolve an issue that reared it's ugly head yesterday.Frame one of main timeline I have the following code:
Code:
import flash.display.MovieClip;
import flash.events.MouseEvent;
[code]....
The newMC doesn't show up.If I add 'parent.' in front of the addChild then it appears.mc_LibItem has a base class of "flash.display.MovieClip" and is exporting for ActionScript and on frame one.For grins I created a new .fla and began messing around with the same addChild idea and it worked.
View 14 Replies
Mar 25, 2009
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
View 2 Replies
Oct 30, 2005
somewhat understood the basics of adding and removing children, however, I am facing another problem. After using the removeChild Function, I can't seem to add another child.For example:
ActionScript Code:
var attachedMC = new (getDefinitionByName("Content1") as Class)()
Page.addChild(attachedMC);
[code].....
View 3 Replies
Jul 29, 2009
I have a main "shell" swf which, by clicking several buttons, will load/unload various external swfs into a Placeholder_mc which resides on the main timeline in Shell.swf In the documentation and tutorials I've seen a couple different methods, and I'm not sure I quite understand the difference, or at least the reason you would use one over the other...In the 1st method, you can just add the Loader object using the addChild() method:
Code:
var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
Placeholder_mc.addChild(myLoader);
This will apparently add myLoader to the display list once it has completely loaded.The 2nd method, you supposedly can add the Loader.content; however, it appears you can only do this once the content has completed loading, so you need to incorporate an event handler with the contentLoaderInfo object:
Code:
var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
[code]....
What are the pros/cons of adding the entire Loader object, as opposed to the Loader.content and vice versa?
View 7 Replies