Actionscript 3 :: Change The Id Of An Object But Still Refer To It With Its Old Id?
Oct 16, 2010
For instance in Flex 4
?xml version="1.0"?>
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
[Code]....
the traces when the button is clicked twice are 'the id is myButton' followed by 'the id is yourButton'
Not just an idle query. I was hoping to change the id of custom components when populating a main app with them
View 2 Replies
Similar Posts:
Oct 1, 2009
I have a container movie which loads another movie into a Loader object which then gets added to the main timeline. The loaded movie has a main class which controls all the other classes in that movie. The container movie has one other element - a scrollbar which scrolls the loaded movie (which is longer than the container) up and down.
When content changes in the loaded movie I need to pass a message to the scrollbar. If I trace parent.parent.parent from the init() function of the loaded movie it traces [object MainTimeline]. My scrollbar, sBar is a direct child of the main timeline, but tracing parent.parent.parent.sBar doesn't work So how can I pass a reference to the scrollbar to the loaded movie? Here's the code in the container movie:
PHP Code:
var ldr:Loader = new Loader();
var sBar:Scrollbar;
ldr.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
[code]....
View 3 Replies
Jan 19, 2012
I want to get information of an object from a previous keyframe. _root. works only for objects on the same keyframe as the code right?
View 1 Replies
Aug 26, 2010
my document class creates custom class variables to load both a slide show and menu .swf instance to the stage.a few questions:my document class extends Sprite, so any addChild() will put that object on the display list?if so, how do I allow script inside the menu instance to refer to other display objects?The following code is within my document class, inside my doc class function:
Code:
/*load menu*/
var menuLoader:preLoad = new preLoad("menu_as3.swf",800,0,1,1,0,1);
[code].....
View 3 Replies
Feb 1, 2010
I would like to know how to access a XMLList object in main timeline from movieclips.Can XML be accessed through 2nd level(nested movieclips)? In frame 1 of main timeline, the XML file has been loaded.
var xmlData:XML = new XML();
var data:XMLList;
xmlData.ignoreWhite = true;
[code].....
View 0 Replies
May 4, 2010
I added a flv into my Scene 1 then i added a new Scene.I just wanted to after finishing the .flv flash go to next scene.but when i added a new scene,and I test my movie,the .flv didnt show and i recieved these errors
[Code]...
View 5 Replies
Feb 8, 2010
I have problems in my flash project. I cant duplicete some pictures or "group items" , when I copy/paste them and when I start to edit that one that I copyed it automacly edit the original version...I cant duplicate this object on picture ( http:[url]....)... what ever I do..it always start to change the oroginal object...
View 3 Replies
Jun 10, 2010
How do you refer can i refer to a Internet url in actionscript 2
View 4 Replies
Nov 24, 2008
I'm having trouble getting classes that refer to each other to compile:
package People {
class Pairing {
var Father:Person;
var Mother:Person;
[Code]...
View 3 Replies
Dec 4, 2003
Is there any way to refer to a certain layers x value, or visibility, or any of those? And if not, what is usually done to preform an action on a whole layer? Should I just make a new symbol out it?
View 2 Replies
Sep 3, 2004
How do i refer to an array name inside an array?[code]...
Now i need something like stuff=array1[3]; (this makes an array called stuff which is a copy of array2, hopefully) and then myvar=stuff[3] (which is "succes").. get it?
View 4 Replies
Nov 23, 2007
Is it possible to have one xml doc for more than one swf, so that i would only need to edit one xml doc as opposed to 12?
View 4 Replies
Dec 4, 2003
Is there any way to refer to a certain layers x value, or visibility, or any of those? And if not, what is usually done to preform an action on a whole layer? Should I just make a new symbol out it? And what effect does groups have in actionscript?
View 2 Replies
Dec 12, 2008
I have balls (...sounded pervert) that are created by duplicateMovieClip, yes, they spawn, but right on top of each other, and I don't seem to be able to do anything to them, I tried ball+i.onEnterFrame = function(){} typed in several different ways ("ball"+i, ["ball"+i] etcetc...) And I just couldn't find How to refer to them. i'm trying to spawn them to random positions and make them move in random directions (got the moving part already coded but like I said I can't name them -> can't use it atm.)
Short version: How to refer to balls that are created by duplicateMovieClip?
View 2 Replies
Mar 16, 2010
I have an array that movieclips are added into depending on the users actions. When they are added to the the array, they are also added to the display list of another movieclip on the stage.I'm trying to refer to them later so I can remove them from this movieclip's display list, but I can't work out the wording.[code]
View 2 Replies
Jun 7, 2010
I have a class that places objects on stage with addChild(obj) it allowes me to position objects using pixels( say obj.x = 10; obj.y= 50; ) just fine but if
I try this: obj.x = stage.stageWidth / 2; I get a message that I Cannot access a property or method of a null object reference
View 4 Replies
Jul 15, 2010
I am using the load movie from my main file (main.swf) as:
mc_zoom.loadMovie("detail.swf");
I then have a loader as a movieclip with the detail.swf
when the movie (detail.swf) is loaded the preloader I am trying to make/set the play to go:
_root.gotoAndStop(2);
But this does not work - it works locally but when used with the main file (main.swf)
View 5 Replies
Oct 1, 2011
I have an object created visually. How should I refer to it from classes of other objects? MovieClip(this.root).someObj or stage.someObj or MovieClip(this.root).stage.someObj? And moreover, if I want to see which frame is current on the main timeline, why I cannot just check stage.currentFrame? Why there is no such property of the stage, currentFrame? It has timeline, right?
View 1 Replies
Feb 9, 2009
How can I refer to an instance on the stage if:
- I added it to the stage using the GUI
- I wrote its implementation in an external AS file
I can't assign it a instance name otherwise I get this error: Code: ReferenceError: Error #1056: Cannot create property myInstance on MyClassName.
View 4 Replies
Feb 12, 2009
i am having problems referencing an mc's instance name via a string var. I think the solution would be simple, but i have been trying different things for a while
ActionScript Code:
var hitarea:Array = new Array;
function populatehitareas()
[code].....
View 9 Replies
Feb 19, 2009
the second bit of code "mc_inst1.onRollOver..." works, but the first bit of code, which tries to loop through all movie clip instances, will not work.I think this is because myReference is a String. But can anyone suggest how else I should construct my reference to the instance name?
Code:
for (var a:Number = 1; a<myCount; a++) {
myReference="mc_inst"+a;
var myClip:MovieClip = myReference;
[code]....
View 5 Replies
Jun 29, 2010
I have 6 movieclips named answer1, answer2, etc. I also have a for loop where I want to assign functions to each one programatically. In my loop if I'm using var i, I wanted to refer to each movieclip with something like answer + i to refer to answer1 (assuming i = 1, for example). However, I don't know the syntax to do this.
Here's a rough shot of my code:
ActionScript Code:
for (i=1; i<7; i++) {
"answer"+i.onPress = function() {
this.startDrag();
[Code].....
View 4 Replies
May 25, 2011
what i have is a sub folder with a swf file... i need the .swf file to refer to a file at the main folder... how can i do that? my structure is like this:
[Code]....
View 1 Replies
Jun 1, 2011
I want to make it so that every five seconds an enemy is in a hitTest with an object the object loses 5 points. I need to know if theres any condition so that I can do an.[code]
View 1 Replies
Jan 27, 2009
I can't seem to find this simple code anywhere. But, how do I access a movie clip on the main timeline from inside another movie clip. I want to:
Code: Select allwallpaper.gotoAndStop("blur");
i've tried
Code: Select allparent.wallpaper.gotoAndStop("blur");r
Code: Select allstage.wallpaper.gotoAndStop("blur");
Code: Select allparent.stage.wallpaper.gotoAndStop("blur");
View 12 Replies
Jan 11, 2008
I have 3 SWFs.
X.SWF - Parent application. Contains an empty movie clip for loading external swfs using loadClip() method.
B.SWF - Has some text and pics. Gets loaded into the empty movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
When I start the main application (X.SWF) and load B.SWF into it all is fine. But would like to click on the 'Load A.SWF' button on B.SWF and load A.SWF into X.SWF. And visa-versa. The problem is I'm not able to refer to the parent container (X) from these child (A and B) SWFs.
View 1 Replies
Feb 21, 2009
I want to enable smoothing for the bitmaps I load using a Loader.
How can I refer to these bitmaps ? Something like Loader.contentInfoLoader as Bitmap?
View 5 Replies
Jun 10, 2009
How do I refer to a variable using strings and other variables? What I mean is, for example, you can refer to an instance of a MovieClip on the root level with instance name "mc1" by doing this[code]...
View 5 Replies
Aug 17, 2009
Just taking Koolmoves for a test drive and ran into a snag, I want to change the opacity of some shapes/objects that Ive created but I cant seem to find an option to adjust the opacity anywhere.
View 1 Replies
Nov 9, 2010
I have been trying to change the depth of an object. I have only just started learning AS3, so I haven't looked into this yet.So far I have been using a trial-&-error method to try to get this piece of code to work which I found on a site, but I have not succeeded:
Code:
setChildIndex(example,numChildren-1);
I am putting this code in it's class, and I tried replacing the word example with 'this'. Can someone please help me? When I test the swf it comes up with this in output:
Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/setChildIndex()
at Foreground/enterFrame()
View 10 Replies