ActionScript 3.0 :: Passing Variables Or Targeting Array Instance

Oct 8, 2008

I can get the variable into Pages.as now but the Loader will not "reload" hen the button is clicked.

View 35 Replies


Similar Posts:


ActionScript 2.0 :: Passing Instance Names Into An Array

Jun 30, 2010

How do you pass instance names into arrays? I've got a bunch of movieClips of states.

They all have instance names.. alabama, arkansas, delaware, florida, georiga, etc..

I am trying to send them all to an array because I need to be able to disable the movieClips all at once and I don't want to call each one separately. I setup an array and a "for" loop, and it properly gets each value in the array:

ActionScript Code:
states = new Array(alabama, arkansas, delware, florida, georgia);
stateslength = states.length;

[Code].....

View 9 Replies

ActionScript 2.0 :: Passing Array Variables By Value Not Reference

Dec 11, 2006

It took me hours to figure our why this was returning the wrong value - when assigning one array to another it passes by reference not Value. I need a way to force it to pass by values. e.g. copy the existing array and have the second array reference it, so i am free to modify the first array without changing the values of the second.[code]From the example above You see that in Actionscript when assigning one variable to another it does it my reference not value. So when you chage the value of one array it changes the value of the other automatically.I need to have the "test2" variable reference the "test1" array only by value so if modify "test1" the values of "test2" won't be modified.

View 7 Replies

ActionScript 3.0 :: Targeting An Instance Of A Mc?

May 27, 2009

With AS2 I u sed to do  createEmptyMovieClip("name"+i, to create multiple instances of an mc. I ocuuld then target these individual instances

[Code]...

View 4 Replies

ActionScript 2.0 :: Targeting AS Generated MovieClips Instance Names?

Oct 2, 2006

Right check this:

/////////////////////////////////////
/////////////////////////////////////
///////////////FUSE//////////////////
/////////////////////////////////////
import com.mosesSupposes.fuse.*;

[code]....

But the problem is the thumbMov movies will obviously have a uniquely generated instance name i cant target directly due to the "for" loop..How can i modify what ive done to target any of the thumbMovs with the FUSE functions?

View 3 Replies

ActionScript 2.0 :: Use Local Instance Variables Vs Attach New Properties To The Instance Object?

Mar 14, 2006

I am wrapping my brain around OOP in AS2. I am making two posts on two different subjects. My question here is: when should I use local instance variables, and when should I attach new properties to the instance object? (Feel free to correct my terminology.) Let's say I have a class for a scrolling background, which scrolls when I mouse over its edge. I want to put these values somewhere:

1) How wide is the border in which a mouseOver makes it scroll? This is basically a semi-constant I set it up once and keep it the same, unless the user changes it in an options menu to make the border wider or narrower. Call this scrollBorderWidth.

2) How fast is the background scrolling now? I want to track this so I can smoothly change the scroll speed over several frames. This is often changed. Call this scrollSpeed.

It seems I have two ways I can store and access these values and darned if I know which is better practice. METHOD A: Make them local variables in the class, so the scrolling background instance has them as local vars. I set them up thusly:

[Code]....

View 4 Replies

Actionscript 3 :: Targeting Specific JavaScript Object Instance From Flash

Jan 27, 2011

first time poster. Let's say a have flash(swf) object on my page, and I have a specific JavaScript class (lets call it "JSClass")that works with that flash object. JavaScript class has some methods for communicating with the flash object. When the flash object is embedded in to page via swfObject, I create an instance of the JSClass, and give it the id of the flash object on the page, so that instance can specifically communicate with that flash object. I have more than one same flash file on the page, and I need to differentiate calls to specific flash objects. Something like this:

[Code].....

How can I call "flashControl1.onFlashReady()" from flash? Note that flash doesn't know which JSCLass instance to target. How can target particular JSClass instances from flash object.

View 1 Replies

ActionScript 1/2 :: Targeting Variables On Different Timelines

May 7, 2011

Flash CS4, ActionScript2.0 -  I have a button and an input text box in a movieclip.When the button is clicked, I need the movie to jump to a frame on the main timeline and have the text that was entered into the input box in the mc, show up in a dynamic text box in the frame on the main timeline.I finally got the movie to jump using 'with (_root) gotoAndPlay ("frame label"), but I can't get the input text value (in the mc) assigned to the dynamic text box (on the main timeline).I've tried several versions of relative and absolute paths in the assignment statement, using variable names and instance names, tried 'with' and 'this' but no matter what I do, nothing shows up in the dynamic text box.

View 8 Replies

ActionScript 2.0 :: Targeting Instances With Variables

Jul 9, 2009

I am working on building a menu of seven buttons (movieclips). When you click on one, it turns it blue. When you click on another one, the previous one needs to revert back to green.What I'm doing is, when you click on the buttons... it loads a number (1-7, depending on the button) into a global variable (menuActive). That variable is then referenced to check which button needs to be turned green when you click on the next button.[code]I have two problems:

1) It doesn't seem to be appending the value of 'a' to the targeted instance name correctly. (If I replace _parent.mcBtn+a with _parent.mcBtn7, for example, it works fine.)

2) It also seems to be keeping the "this.gotoAndPlay("btnOn"); parts from working properly.

View 3 Replies

ActionScript 2.0 :: Targeting Items In An Array

Apr 20, 2010

I'm a bit green when it comes to code and I have a specific thing I need to do which has had me going round in circles (no laughing at the back!). It must be pretty simple but I'm stumped! Basically I have 6 movieclips on the timeline with instance names 'btn1', 'btn2' etc to 'btn6'. These movieclips have an "on" and an "off" state (frame labels)

[Code]...

View 2 Replies

Actionscript 2.0 :: Targeting Buttons In An Array?

Feb 5, 2009

i have a series of buttons in an array, and i want to change the alpha of all of the buttons when a button (outside of this array) is clicked. i can change the alpha of all of the buttons inside the for loop, but not when the button is clicked. (the button is functional and being referenced correctly, as the trace does work.)what do i need to do differently to be able to control these buttons?

Code: Select all
var theBtns:Array = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8];
for(i=0;i<theBtns.length;i++){

[code]....

View 3 Replies

ActionScript 2.0 :: Targeting Items In An Array?

Apr 21, 2010

I'm a bit green when it comes to code and I have a specific thing I need to do which has had me going round in circles (no laughing at the back!). It must be pretty simple but I'm stumped!Basically I have 6 movieclips on the timeline with instance names 'btn1', 'btn2' etc to 'btn6'. These movieclips have an "on" and an "off" state (frame labels)

I make an array:
ActionScript Code:
var buttons = [btn1, btn2, btn3, btn4, btn5, btn6];

[code]....

View 5 Replies

ActionScript 3.0 :: Drawing App - Targeting Objects In An Array

Sep 7, 2009

This seems like it should be fairly simple, but for some reason Im getting caught up when it comes to removing a layer from my drawing app, and when moving the layers up and down in the display list. My first problem is that when I do the (canvas.removeChild(layers[value]); it removes the child of the targeted layer, but it also removes the child of the objects before it? I think anyways.

The second problem is that my layerUp function works, but my layerDown does not, even though they are the same code? Confused I am indeed. I'm sure its fairly messy since Im just learning this stuff, so sorry for that too!

[Code]....

View 0 Replies

ActionScript 2.0 :: Targeting Dynamic Text Box In An Array?

Sep 13, 2005

I'm trying to target a dynamic text box for a slideshow that is located in an attached movieclip.This is the array:var slideShow = ["slide1", "slide2", "slide3", "slide4"]; Each slide is a movie clip that is loaded with attachMovie(). These movies each have a dynamic textbox named "slideDescription". How would I be able to target that text box and get it to change the desciption each time I move to the next slide in the array?

View 1 Replies

ActionScript 2.0 :: Targeting Dynamic Clips In Array?

Jun 29, 2006

I made an array containg 3 clips and dynamically attached them to my main timeline. I can successfully tween all of them with the following code.

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

[code].....

View 2 Replies

ActionScript 3.0 :: Targeting A Textfield Created With Array?

Nov 18, 2009

I need to be able to set a property of the 3rd textfield created within this for loop:

Code:
for (var i:int = 0; i < menuArray.length; i++) {
menuText = new TextField;
menuText.name = "navBttn_" + i;

[Code].....

View 6 Replies

Javascript :: Flash - Passing An Array Of Objects Instead Of An Array Of Arrays?

Jul 13, 2010

I'm passing a Javascript Array() to Flash via FlashVars but Flash complains. Can you guys point me what am I doing wrong here?

javascript code
// array with the user defined cities
var usercities = new Array(

[code]......

View 3 Replies

Javascript :: Passing An Array Values From Html Into Flash Array?

Oct 20, 2011

anyone knows how to pass an array values from an HTML into flash? Well, to begin I'll discuss what am I doing. I edited a twitter widget javascript which search tweets based on the hashtag I needed then passing it on an array per tweet and then displaying it using a <div> it updates once every 5 minutes. Now I want to display those tweets on a dynamic text on Flash. Let's say I will have 5 dynamic text placed on my flash file then; I want each of those dynamic text to have the tweets I have based on on my HTML arrays to be displayed in random.

View 2 Replies

ActionScript 3.0 :: Targeting MC - Setup With MouseEvent Handler In Array

May 7, 2009

I have some buttons (dynamic mc's) set up with an ROLL_OVER/ROLL_OUT MouseEvent handler and have put them in an array.

Code:
var btnArray:Array = [];
for(var i:int = 0; i < 5; i++) {
var bg:Bg = new Bg();
bg.width = 173;
bg.height = 20;
bg.x = 25;
bg.y = (22 * i) + 40;
bg.name = "bg"+i;
[Code] .....

The problem is I can't seem to target the dtr mc's (Dot) at all even when they're in an array. Anyone have any strategies I can use to make this concept finally work? I've been able to do it as long as the dot mc's are a child of the button mc's, but I don't want the rollOver/rollOut effects to effect the child, therefore the separation.

View 7 Replies

ActionScript 2.0 :: [Flash 8] Targeting And IFrame From A Link Array?

Sep 25, 2007

I have dynamic links that I'm pulling from an already published RSS feed [URL] using the xml in said document.Now, the 'client' wants the video links from this document to link to an iframe above the flash interface. No problems targeting the iframe when the links are hardcoded into the flash piece, but they want complete control (yes, I know they're asking for a miracle). Here's my piece so far:[URL]

Here's the function and variable that pulls the links and titles: Code:

Code:
function getPageTitle(ind):String{
var this_text = "<a href='" + _level0.link_array[ind] + "'>" + _level0.title_array[ind] + "</a>";
return this_text;

This is what I tried (along with just single quotes and double quotes), but to no avail: Code:

Code:
function getPageTitle(ind):String{
var this_text = "<a href='" + _level0.link_array[ind] + "'" + ", "video_swap">" + _level0.title_array[ind] + "</a>";
return this_text;

View 1 Replies

ActionScript 3.0 :: Flash Dynamic Objects And Array Targeting?

Dec 18, 2011

I'm trying to create a movieclip from the library dynamically on a certain event and then being able to target one specific movieclip by name after they've been created. I'm having problems being able to target and have tried a tone of different approaches, I think I'm close but I'm getting the error '#1006: getChildByName is not a function.'

Code:
package {
import flash.display.*;
import flash.events.*;

[code]....

View 14 Replies

Actionscript 3 :: XML - Targeting Node Attribute Push Into A Flash Array?

Mar 15, 2012

I'm trying to push just the contents of the "txt" attribute in each "question" tag into an array named "questions" in AS3 Flash. Here is an excerpt from my xml file.

[Code]...

View 3 Replies

ActionScript 3.0 :: Passing An Instance Name Argument Into A Function?

Sep 29, 2010

Well I want to set up a function that will calculate the x position of where my MovieClip's instance name will go. Here is the code i currently have.

function xBtnPosition(btnName: String, btnXpercentage: Number):String
{
var xFinalPosition: String = -(((btnName.width * btnXpercentage) / btnName.scaleY));

[code].....

View 3 Replies

Actionscript 3 :: Get Instance Name From Constructor Without Passing Parameters?

Nov 15, 2010

is it possible to obtain the instance name of a class from the class without having to manually pass the instance name as a string parameter to the class constructor?

//Create New SizeClass
var big:SizeClass = new SizeClass();
//-------------

[Code]....

View 2 Replies

ActionScript 2.0 :: Passing Instance Name To Function As A Variable?

Apr 24, 2006

k the idea is that this movie keeps tracks of whatever page it's on using the variable current. when the button evolution is clicked it should jump to frame 2 of the movie whose instance name is contained in the variable current and also pass this variable to a function called alpha which fade that movie's instance when moving to another page - then that page's name will be assigned to current.

this is the code that i have now..

#include "alpha.as"
evolution.onRelease = function() {
this[current].gotoAndPlay(2);
this[current].alpha(5, 0);
};

all these buttons and movie instances are contained in the same movie clip and the variable current is declared in it too.

View 1 Replies

Flash :: Use Of The Array.filter() Method For Searching And Retrieving An Object Instance From An Array?

Jul 13, 2010

I am curious if this is an okay implementation of the Array.filter() method.

[Code]...

I was not able to figure out an implementation of the callback function for the filter() method, where the callback was outside of the getGallery() function. I wonder if there is a way to get the isGallery function outside of the getGallery scope?

View 1 Replies

ActionScript 3.0 :: Passing A String As A Movie Clip Instance Name?

Oct 17, 2010

I thought this would be a simple one, but i am stumped.  So I resulted to using this less than optimal solution, just to get it working...

if (lobby.gamemap.selectedItem.label == "Map1") map.AddMap(new Map1)
else if (lobby.gamemap.selectedItem.label == "Map2") map.AddMap(new Map2)
//Map1 and Map2 are movie clips in my fla library, with linkage Map1 and Map2

[code]........

View 5 Replies

ActionScript 3.0 :: Passing Instance In A Dynamically Defined Function

Feb 20, 2012

I'm trying to define this function so I can pass the CardButtons sprite to the Add Cards function. It "works" but there's one problem: the CardButtons sprite used in the function is determined by the value of i at the time of the function call (or in other words, the value of i when I click the sprite).
 
I want the sprite passed to be literally the value of CardButtons[i] at the point when the function was defined.
 
CardButtons[i].addEventListener(MouseEvent.CLICK, CardFunctions[i]= function(){ AddCards(CardButtons[i],PlayerHand[player-1][PlayerHand[player-1].len gth-1]);});
  
Is there a way I can do this, or is there a better way to do what I'm trying to do?
 
I guess for further example:
 
I want CardFunction[0] to store the AddCards function with the value of CardButtons[0] passed, it should NOT be dependent on the value of i.

View 3 Replies

ActionScript 3.0 :: Create A MovieClip Instance By Passing A String?

Dec 23, 2009

I have a problem in instantiate a movieclip in the library using a string variable.

Assuming i have the string with the class name of the movieclip like this[code]...

View 1 Replies

ActionScript 2.0 :: Passing XML-based Hyperlink Into A Button Instance?

Jun 23, 2007

I'm currently trying to load specific XML data as a hyperlink into a button,the hyperlink is saved in the xml-file, and called upon by "childURL", now if I assign this function to the child_mc, which is formed into a menu dynamically within an instance named emptyMC, it will give me the link:

Code:
btnLink.onRelease = function() {
getURL(childURL, "_blank");
};

problem is I want to assign the link, when the child_mc-movieclip is clicked, to a button named 'linkbutton' on the main stage which will then load the page assigned in the xml-file when clicked.How would I load this data inside the button on stage? All codes I tried just open my browser and link to nowhere.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved