ActionScript 3.0 :: MC Can Be Named Like An Array?
Mar 14, 2011
I'm trying to make some dynamic movie clips, with a drawn rectangle inside a for loop. But I can't figure out if an MC can be named like an Array. How close is this?
Code:
function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
[Code]....
View 3 Replies
Similar Posts:
Nov 16, 2010
I'm trying to get data out of an array. Problem is the array I'm trying to access is different depending on where I'm currently at.
I can get data from a dynamically named variable, like so:
_parent["Menu" + Menui + "Button" + Listi + "Link"]
but now that I want to access one field in an array, instead of a single variable, I don't know the syntax to get at it? Waa. I tried:
_parent["Menu" + Menui + "Button" + Listi + "Link[" + Linki + "]"]
but it didn't like me.
View 2 Replies
Oct 2, 2009
A snippet of my code is [code]The first element in the mainOptions Array is linked (metaphorically) to tab1.The second element in the mainOptions Array is linked (metaphorically) to tab 2 and so on.I want to create 12 variables named AudioMP3, AudioHEAAC, NewsBBC, NewsTwitter, VideoVideo and so on down to PicsPics2. i.e concatenate each entry in say tab1 through 5 to the each element from mainOptionsArray and make a new variable using that name then assigning a number to this variable.[code]
View 1 Replies
Jan 17, 2011
here is my new code that works for PART of my movie. i have two dynamic text boxes, one named "item" and one named "ssnumber" ssnumberNode works fine but itemNode does not. i bolded the parts that i think are relevant to the problems
[Code]...
View 3 Replies
Oct 18, 2009
I have just entered Falsh and for some strange reason none of my layers are named. Not only that, when I draw a circle for instance and I want to move that circle. I have to move the line and the fill seperate... I think this has something to do with the layers not being named. I will be posting a print screen. Click the link. [URL]
View 3 Replies
Nov 10, 2009
Trying to get from AS2 to AS3 and the simpliest things are taking too long.I have some movieclips on the main timeline named...
btnSm1_mc
btnSm2_mc
btnSm3_mc
[code].....
View 2 Replies
Dec 11, 2010
I am making a game and it has falling objects (similar to shooting) and it also has some other random generating objects going to the other direction. So the objects aren't already on the stage. I was wondering if when I spawn them if I could put them in an array or something and check collision between the two arrays or what?
View 3 Replies
Jul 6, 2009
how can i make named anchor links in flash, i tried this: [URL] i dowloaded the sample, it works as it is with as1 but it doesn't seem to work with as2?
View 1 Replies
Jan 23, 2010
Inside my loop, where i get my XML objects I added a code to draw and add the mask:
var myMask:MovieClip = new MovieClip();
// settings for width height x y color fill etc etc.
myMask.name = "NAME-"+i; // set the NAME
myContainer.addChild(myMask);
myContainer.mask = myMask;
the mask looks fine on the stage.now since i name it, i want to use it for other purpose like moving it now i want to actual call myMask
i get my number "num" from other function, that works fine
function applyMask(num:int):void {
// need to call myMask("NAME-"+num)
}
i have tried myContainer.getChildByNamehave tried:
var masking:myContainer=getChildByName("NAME-"+String(num)) as myContainer;
i have traced for options i can think of myself, but all result no property found.
View 3 Replies
Jul 3, 2011
i'm experiencing a strange issue, until now i alwasy have used "onMotionFinished" without problem, like in this way...[code]suddendly, without any reasons, i get this error in the compiler when trying to publish no property named "onMotionFinished" (i translated it from italian language)i tried also opening other fla i created with the same actionscript, that have always worked fine.there is no way to use the property again.url...
View 4 Replies
Aug 23, 2010
I have a situation where I use loadvars to load an xml file, which has the address of 2 swf's on the server. I can trace the xml items so know they are loading. So I'm trying to load the swf's but am running into problems. First problem, the swf always gives an error when I publish from flash, "TypeError: Error #2007: Parameter url must be non-null." as it can't find the mention of the xml file, as it's just being published. I'm not sure this affects the next issue which is the swf not loading when I try to load it like this:
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest(loadswf1); // where I know loadswf1 = "myswf.swf"
loader.load(defaultSWF);
[code]......
View 1 Replies
Jan 20, 2012
Novice Flash dev here. I'm having a bit of trouble passing the name of an existing MC on my stage to a new variable and then tweening it. I've tried everything I could find.Here is the set-up:
3 levels of question difficulty: Easy, Moderate, Hard. Each question is a seperate MC in the library.Each question has two strings of text: one normal and one altered.container_MC contains all of the questions.Inside container_MC each frame contains one of the question MCs along with a second MC called highlight.Each of these frames is then labeled with the difficulty of the question and the question number i.e. easyQuestion1.Highlight is a MC containing a box that surrounds the alteration. It is labled the same as the frame +"Highlight" i.e. easyQuestion1Highlight.Each of the highlight boxes has Alpha =0.Each frame also contains the variables that determine the correct answer and the difficulty of the question.NONE of the objects on the stage have been added dynamically with addChild (note the Novice portion of my intro :D).
On my maintimeline I have one instance of container_MC. If the player selects the correct answer the current frames highlight box changes from Alpha =0 to Alpha =1.
[Code]...
View 1 Replies
Jan 15, 2009
how do I word this:
var crntContArray:Number = 0;
var currentArraySub = mstrContArraySub ... crntContArray;
the array I'm trying to access is named mstrContArraySub0
View 5 Replies
Jan 14, 2011
I tried: ActionScript Code: navigateToURL(new URLRequest("#myAnchor"));
To my surprise this doesn't work. In fact it doesn't even seem to do anything at all.
Is there a way to do this?
View 2 Replies
Feb 22, 2012
i'm making use of scripted control on IK armatures. The wierd thing about ik is that the armatures seem to exist in a disconnected manner from the objects they control, and cannot be found anywhere in the display list under their parent object.
Instead, the only way i've found to get references to runtime armatures, is by accessing them through the ikManager class, with: IKManager.getArmatureByName
This allows me to get them by names which i've manually assigned in the IDE at authortime. I'm only using one actor with armatures at a time right now, but i'm troubled to think of how this will work with multiple instances of the same IK object.
Given that i'm going to be having multiple armatures in existence with the same name simultaneously, how can i tell which one belongs to which object?
View 1 Replies
Jun 1, 2009
I use only div into my html page.
Is it possible to redirect navigateToURL(request .. to _mypage in state of _blank ?
Code: Select all<div id="contenu">
<p>Le titre de mon article</p>
<p>Le titre de mon article</p>
</div>
View 7 Replies
Feb 7, 2010
how do i browse through all the children with the same instance names from a movieclip?note: this movieclip has some children with other names as well.
View 2 Replies
Apr 3, 2012
I'm building a variable matching game. The player clicks one of four choices and then clicks the answer area. Their choice appears in the area, and if the answer is correct the answer container shifts down, highlighting the next answer area to be filled. Inside the container are a large number of these answer areas (60).
What I am trying to do is have only one be answerable at a time, the highlighted one, so that players can't skip ahead despite seeing the empty spaces left to answer in. What I have right now isn't working, and I could use some outside insight.
Code:
var i:int =1;
function sampleFunction(evt:MouseEvent):void{
if(selection == e.currentTarget.targetCorrect){//targetCorrect is a string set statically
[Code].....
I realize I could use a for loop to add the event listener, but the project really calls for only one answerable area at a time.
View 2 Replies
Feb 5, 2009
My problem is that I cant figure out how to draw my movieclip if I dynamicly name it.
However If I address it by using its actual name it works fine.
I have included both working and non-working code.[code]....
View 2 Replies
Sep 8, 2009
It is possible to loop through buttons in a movie clip that do not have sequential names.For instance, they are all named by the date they are for reference to a database.
View 1 Replies
Jun 18, 2010
i'm trying to create a dynamically named Vector. i have a critical project deadline tomorrow, and this small problem is holding back continued development i've adapted my code from this example [URL]...yet am getting an error message (see below). here is what i have:
[Code]...
View 9 Replies
Oct 20, 2010
I have an array of external images that I am loading and the number of external images is variable, so I want to be able to create loaders to load them as needed. Is there a way to dynamically create and uniquely name a loader at run time?
Otherwise is there a way to pass the image content off in such a way that it will remain loaded if the loader is used to load other images?
View 3 Replies
Jul 27, 2010
I'm trying to create a dynamicly named object.
something like
private var myVar:String = "dynamicName";
private var [myVar+"staticName"]:Object = new Object;
but what i wrote above dosn't work for some reason.
View 2 Replies
Mar 26, 2011
What I am trying to do is kind of odd, but I am wondering if anyone can come up with a clever way to do what I want to do. Basically, I want to re-define a named function at runtime. I can do this with anonymous functions, but I can't figure out a way to do it for named functions. I want to do this so that I can implement a "spy" functionality on an object for a testing framework (a port of Jasmine to Flex).
Take, for instance, this class:
public class TestClass
{
public var anonymous:Function = function():void {
trace("original anonymous");
[Code].....
Can anyone more clever than I come up with a way to hack this? Can the bytecode be hijacked? Something?
View 3 Replies
Aug 13, 2011
I have created 3 movieClips and I added into another movieClip container named as mc.
for(i = 0;i<3;i++)
{
imgBox = new box();
mc.addChild(imgBox);
imgBox.name = "box" + i;
}
[Code]...
View 1 Replies
Oct 15, 2009
I've created an amount of MC based on my XMLlist, and each assign with an attribute/ID stated in the XML. I'm now trying to trace back the parent of the assigned MC properties, how could I do that?
ActionScript Code:
private function members();:void {
xmlList=myXML.children();
var trunksX=trunks.x;
var trunksY=trunks.y;
for each (myXML in xmlList) {
[Code] .....
View 0 Replies
Dec 1, 2010
If I have a movie clip with named frames, can I reference the frame names in an if-else statement? For instance,
if (frame name = "frame1")
gotoAndStop.frame2;
etc. Is that doable?
View 5 Replies
Dec 9, 2010
I've dynamically created a grid of buttons which are going to modify a 2D array, but I can't work out how to create a unique function for each iteration of the loop with a dynamic function name. Probably just a stupid syntax error by me...
ActionScript Code:
for(var i:int = 0; i < 8; i++){
for(var j:int = 0; j <
[code].....
View 3 Replies
Apr 13, 2011
So I've been trying to make dynamically named functions, and while it works, I've run into a couple of problems.
ActionScript Code:
var uServer:String = "irc.epic-chat.net"
var lol:String = "lolz"
var num:Number = 3
[Code].....
If I had something like that ^ what could I add to func to distinguish between whether it is being called by lolz0, lolz1, or lolz2? I was thinking whether there was something like .name I could use, but I couldn't come up with anything.
View 9 Replies
Sep 14, 2004
I'm reading Colin Moocks Actionscript for flash MX book and upon reading functions he instructs to create a symbol named ballSymbol, than put an instance on the stage (frame 1 maintimeline) and call it ball. Than on frame 1 on the main timeline put the following actionscript:
Code:
_global.mainTimeline = this;
function moveBall() {
mainTimeline.ball._x += 10;
mainTimeline.ball._y += 10;
};
moveBall();
The ball is supposed to move diagonally. But my problem is when I test the movie, nothing happens. No movement, nothing...
View 3 Replies