ActionScript 2.0 :: Referencing One Element From Another?
Jul 13, 2011
I made the mistake of purchasing one of those flash template sites. I have most of it customized, however I need to flip between gallery images when the user selects the menu item. how to reference one element from another... I need the release event of the menu item (which i already have stubbed out, to trigger a tweenMenu function call... however, I don't know how to get the path of the argument to pass the object to the tweenMenu function call.
I need to make this call (in theory)
tweenMenu2(_root.gall, _root.xkoord[(_root.small-1)] );
however, the path to gall is:
_level0.instance146.gall
how i would make the above call using the correct path to gall?
View 0 Replies
Similar Posts:
Mar 9, 2009
I've got an array containing various sprites... I'm wanting to reference the sprite I want by its name rather than its index in the array, and was wondering if theres a simple way of doing this? I know I could do a for loop through all the array elements and see which one has a name that is equal to the name im looking for, but is something along the lines of myArray[elementName] possible?
View 5 Replies
Mar 18, 2012
I know that there is no such function as getElementByName in Flex but I also now that you can do this["object_id"] to get the element of the application u're in.What about getting an element inside another element?I've tried making element["id"] ? But in my try-catch it always runs the "catch" part..how do I get an element inside another element just having it's id in dynamically created string form?
View 2 Replies
May 10, 2010
I have flash where there is a link for song download. And, at the bottom of the flash I've a count, loaded thorugh flash vars which should increment everytime donload button is hit. Please let me know what approach should i take to do that. can i call a Java method on donload button which will insert a row in the table and and then get the count and render it to the count variable in my flash?
May be this extremely confusing. Here is a very similar example on how it is done. This is actually very similar to what i want to do. [URL] on this link there is count below which increments you hit the download button.
View 1 Replies
Oct 25, 2010
I've built a rather robust tooltip class recently that attaches and draws a single tooltip sprite to the root, then uses MOUSE_OVER to detect when it is over a tooltippable object, and shows the appropriate tooltip text. At the moment, I'm ensuring that any elements in my application which wants to take advantage of showing tooltips implement the ITooltippable interface, and expose a public getter, get tooltip().
[Code]...
View 0 Replies
Apr 13, 2006
Basically I have 14 text boxes, each box draws its content from an external txt file. Next to each text box is a button. I want the button to be either visible=true or visible=false depending on weather or not the text box has content or is "undefined" Here is what I have so far, and it's not working:[code] I would like a FOR loop to just run through the variables and check to see if any of them are undefined. if it is, then make the correct send button invisible.
View 8 Replies
May 23, 2011
<root>
<function name="lala">
<metadata name="foo" />
[code].....
View 1 Replies
Feb 23, 2010
I am unable to access 2nd element and 3rd element (I can acces 1st element.[code]
View 1 Replies
Dec 3, 2010
when I create an element with this method :
this["nodeValue"+i] = new TextField();
(surely in dynamic class )
then I want to change instance name of that element.when I trace this["nodeValue"+i].name.I got a different name for that element ! f ex : instance8 .how can I get "nodeValue"+i from my element and change that .is it read only ? I want to swap tow element's instance name !
for example :
this["nodeValue"+i] to this["nodeValue"+i+1]
View 4 Replies
Oct 20, 2008
I am having a problem with my drop traget. I have the ability to drop and duplicate multiple objects on a stage. I have a clip set up (canvas) which is used for if someone drops objects onto this it duplicates the dragged clip.
However the problem I am having is that if someone tries to drop an element on top of an already drop/duplicated element, it wont duplicate the new clip. Its like it thinks that the dragged clip is not over the canvas.
View 2 Replies
Mar 28, 2009
I have a varible in my root
Code:
place = "1";
i want to refence it in one of my MCs so that i can run a statement like this:
[code]....
View 2 Replies
Oct 24, 2009
basically i was trying to make a program execute on the web, but it needs to load in pictures and since i didnt want to make the file size massive i converted where the images would show into a movie clip and used the loadMovie(pathname) procedure (im using AS2) to link the files, it works obviously when i test run it. in the pathname section i have "images/pic1.jpg" and so on for the different pictures as a tutorial i followed lead me to believe that it would find the pathname the program is running from and add the suffix images/pic.... etc to find the picture.
the problem is when i run it on the web its still trying to find the files on my computer, even though there is no part of the code that tells it to look in my documents/folders etc. even when i tried to link the file exactly, so put in oadMovieMy question is why is it still trying to find my local document folders instead of looking at its own run source on the internet. is there a way of absolutely linking it to the images i have now on the internet instead?
View 4 Replies
Feb 14, 2011
I'm trying to read an XML file with actionscript 2.0
The problem is I can only make my code to read a value of a tag by referencing their position.
e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes[0].firstChild;
How do I retrieve a value from an XMl file by referencing their tag name?
e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes['icon'].firstChild;
Here is my XML file...
<weather>
<current>
<icon>Partly cloudy</icon>
[Code]....
View 1 Replies
Sep 25, 2011
I have a process set up to create action script files. They hold functions that are called upon by my flash project. How can i reference these files so that the project knows the functions are there. with asp.net i would simply reference the .js file. Is it the same process?
View 1 Replies
Sep 29, 2010
I've got another problem (similar to my last), although this time it's movie clip names, rather than variables.[code]I've created some movieclips as such ^ so for each user there are 2 empty movie clips, and now I'm trying to reference to these movie clips, but am having some trouble in doing that, for example:[code]While the last one doesn't bring any errors, it still doesn't seem to work.[code]
View 9 Replies
Nov 12, 2010
How do you reference and already existing object in as3? My below program draws 2 circles and a line to connect the two. The circles and the line are all individual objects. The line (connector class) has a function called update that should redraw the line between the two circles. It has two variables which I want to be the references to the two circles. The circles (coolcircle class) has a variable which I want to be the reference to the connector. It doesn't seem like my update() function is getting called.
ActionScript Code:
package
{
[code]......
View 3 Replies
May 26, 2011
I wish to pass a reference to _camera.y, but _camera.y is a primitive and gets passed as a value.Here's the code for a little debugging class.
ActionScript Code:
package
{
import flash.events.Event;[code]..........
If I call watch("Cam Y", _camera.y) I get "0" traced out all the time - I assume because the y position of the camera is being passed in as a value.I want to pass it in as a reference so that this little class will keep an eye on the y position of the camera.
View 2 Replies
Nov 6, 2003
I am crating a roulette wheel dynamically. It has one movie clip for the numbers around the edge which it duplicates and positions correctly. My problem is that ever other number has a black background on it (on a real roulette wheel)
Is there a to distinguish between an odd number and an even number
Eg
[AS]
if (i = odd )
{
[Code]....
View 5 Replies
Jul 25, 2005
've created number of "total" movieclips inside "mcThumbnails" using crateEmptyMovieClip function via "for" loop.> their names are as follows: t0,t1,t2,t3,t4,...., t<total-1>> their depth is absolute starting with 500, not using getNextHighestDepth(); now i would like to remove all these created movieclips using a button onPress method
View 7 Replies
Mar 23, 2007
I'm confused as to how to reference a movieclip after using the attachMovie method. Here is my code:
[Code]...
View 1 Replies
Jun 13, 2007
I can get it to display a chosen club name by setting the variable var1, but I need it so users can click different movieclips to select which club they want (ie change the value of var1)Also I realise as it is at the moment this will not be possible as its only calling displayContent when it initially loads up.
Code:
///////////// Get XML Info /////////////
function loadXML(loaded) {
if (loaded) {
_root.xmlNode = findNode(this, "teams");z
[code]....
View 3 Replies
Jan 14, 2009
I'm making a sports roster for my school's website and I want to use actionscript to save me time updating. Is there a way I can use actionscript to "reference" to a value (<td uV="1.000" class="ig_a78ff5c6_6 StatsField"><nobr>1</nobr></td>) on a webpage (http://www.maxpreps.com/michigan/bas...th=,local,team) so that when the value is updated, it would reflect on my roster?
View 4 Replies
Apr 18, 2009
I'm an old C programmer been away from programming for years. Now we have a project requiring Flash and I've been elected. Just installed CS4. I have 16 panels in 4 sets of 4 that rotate left to right. (Big learning curve on that one - fading transitions in the right order...). Each panel must have a unique url when clicked. (16 urls).I've looked through many solutions, most of which seem unduly complex. I think that the simplest short of going to onRelease() with AS2 (Later I have to add mouseover changes in the graphics) is something like this:[code]I haven't found this solution out there. Is there a gotcha because the a#Link vars are accessed as global within the scope of handleLink? It doesn't feel right, but it works fine and 16 global variables doesn't seem too bad.
View 2 Replies
Aug 3, 2009
I am having trouble dynamically changing the reference to root in my movies. Here's what I'm trying to do: I have a main movie(_level0.mainMovie) that I am loading external .swfs into. However, I want to be able to test the child movie clips without having to load them into the mainMovie(for testing purposes). In such a case, the child clip would be at _level0 or _root. I would like to add some code to the child clips to test whether they are the _level0 clip, if not, then I want to change their reference to _root. Here's what I've come up with, which doesn't seem to work:
Code:
function testLevel(){
//This code goes into each child clip to see if it has been loaded into another clip
trace(this);
if(this == _level0){ //If this is the _level0 clip
[code]....
View 4 Replies
Nov 12, 2009
Basically I guess it is a reference problem I do have. (1120: Access of undefined property images) For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask. My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite "images".
[Code]...
So, how do I point my line of code responsible for moving the textContainer from within Scrollbar.as at the textContainer sprite? Running against a wall since the last 6 hours and couldn't find any proper tips on the web.
View 5 Replies
May 27, 2010
How can you get a script on a clip to reference its own clip?'this' seems to only return the path up to, but not incuding the button.For example, say I want a movieclip to delete itself when clicked, but I don't know the name of the clip:(Or self-reference anything in a dynamicaly created MC)
on (release) {
this.removeMovieClip();
}
Obviously, this doesn't work.I've worked around this problem by inserting the script on a transparent MC inside the target clip - on top of any other goodies that happen to be in the clip. This gives me a layer to click that doesn't hide the other stuff, and 'this' refers to the correct item to delete, letting the above script work.But this seems a clunky way to do it, and I think the transparent layers are causing a performance hit.
View 4 Replies
Feb 2, 2011
I'm trying to reference the stage from my view class(AsteroidSuppyView). The view is a child of the document class. I'm tryng diffferent ways to do this but i'm getting the error:Code:1152: A conflict exists with inherited definition flash.display:DisplayObject.stage in namespace public.my view class is:
Code:
package
{
[code].....
View 2 Replies
Nov 6, 2003
I am crating a roulette wheel dynamically.It has one movie clip for the numbers around the edge which it duplicates and positions correctly.My problem is that ever other number has a black background on it (on a real roulette wheel) Is there a to distinguish between an odd number and an even number
Eg
[AS]
if (i = odd )
[code].....
View 5 Replies
Feb 17, 2009
I'm having issues trying to reference a movieClip after attaching it. What I have is:
Code:
btn_instructions.onRelease = function() {
instructions = true;
attachMovie("parchment", "mc_parchment", getNextHighestDepth(), { _x:280, _y:280 });
} mc_parchment.btn_close.onRelease = function() {
instructions = false;
trace("close");
removeMovieClip(mc_parchment);
}
The first is creating it on top of the other items that are created during the game. I can't have the instructions on the timeline and just change the visibility of it due to all the assets this game is making. The instructions variable is used in an if statement elsewhere in the game to lock the user controls so they can't create anything else in the game while your viewing the instructions. The second function is the one that should close it. The movie clip that's attached has a button in it, with the instance name btn_close. The trace doesn't even pop up so it's not targeting it correctly. Yet when I go to 'debug' and 'list objects' both mc_parchment and mc_parchment.btn_close are listed as being in the scene after clicking the instructions button.
View 2 Replies
Mar 17, 2009
In As 2 you were able to reference a linkage ID using a string.Example
Code:
var strName = 'home';
attachMovie(strName+'_mc', strName, 1);
[code].....
View 3 Replies