ActionScript 3.0 :: Reference Between Two MCs
Oct 19, 2009I have two MCs - main.swf and sub.swfIn main.swf I've created a loader object which load my sub.swf.How can I refer from sub.swf to loader object which is in main.swf?
View 1 RepliesI have two MCs - main.swf and sub.swfIn main.swf I've created a loader object which load my sub.swf.How can I refer from sub.swf to loader object which is in main.swf?
View 1 RepliesI need to remove the word Button from the reference to reference the actual item that will be tinted.
[Code]...
I'm having this frustrating error showing up and I have no idea why. Let me show you my classes and see if you can spot anything wrong.
First, here's my ILode interface:
ActionScript Code:
package com.schelterstudios.lodeSystem.flash.lodescode].....
So the problem I'm having is the compiler is throwing that 1000: Ambiguous reference error for any reference to instance.priority or instance.label. Why??? Instance is typed to IFlexLodeInstance, and IFlexLodeInstance lists method signatures of priority and label getters, and it inherits ILode, which lists method signatures for priority and label setters. What can I do to get the compiler to stop complaining?
My code is an external .as file. Google provides this code on their demo, which contains the this keyword:
[Code]...
Notice that I have 4 calls to console.log. The first 3 fire, but after the new GATracker statement, the 4th does not fire. I have a feeling that I'm overriding the entire package with the object created from new GATracker when I should be passing a different context. I believe the correct context I should pass is whatever this defaults to when not inside of a package/external file, I assume it references the main stage object.
package uk.co.bigroom.utils
{
import flash.utils.Dictionary;
/**
* Class to create a weak reference to an object. A weak reference
[code]....
In this Class, how they denote one as Weak Reference and one as Strong reference.
I'm trying to create a swf so it always pulls images from a folder (e.g., containing image1.jpg, image2.jpg, etc), so if someone needs to easily swap out images they can do it by simply replacing image1.jpg. Is this possible?
View 5 RepliesI want to print the content of the label property in the Alert window.[code]...
But the Alert window is completely empty. What am I doing wrong ?
I guess the keyword "this" is referencing the application instead of the LinkButton, right ?How can I reference the LinkButton itself, without having to add an ID to all my linkButtons?
I have a loop that i need to go through a bunch of mc's names sequentially - panelq1, panelq2, panelg3 how to reference the mc using +i ?
ActionScript Code:
// Populate question 1
panelq+i.section_txt.text = quizXML.question[i].section;
is it possible to make an XML file reference another XML file? Like I have an XML like so:
[Code].....
how would I do that? or if that can't be done, any alternative method?
I want to be able to reference the text of a text box within an MCThe MC is called "box1", the text field is called "field1"...I have many MCs (all with field1 in them)... box1, box2, box3 etc etcObviously I can set the text to being something by saying...box1.field1.text = "set_this_text"However, I'm using a variable to come up with the "box1" bit. (Using an array and a loop to figure out which box I want to update based on where the user clicked). So, let's say I have a variable... and I want to say..boxClickedon = box1 //will be defined by userSo I don't know in advance about box1... I can only access it through "boxClickedin" variable, but
boxClickedin.field1.text = "set_this_text"
or
[boxClickedin].field1.text = "set_this_text"
[code]....
I am trying to understnd some of the things about packages, I have expand a book exercise and I am now trying to workout how to reference a return value within this package.I have put together this package
Code:
package classes
{
import flash.display.*;[code]....
What I am trying to do is use the 'return(spot1);' value where 'new smiley1(); is.My goal is to be able to create the library object name, (in this case smiley1 from a string variable and then display it on the stage with addChild.At this stage I am just trying to work out how to swap 'new smiley1' with the 'return' value.I will work on the addChild bit next.
I have on the first scene, which is named "Edicion", a series of input text fields, which is intended for the user to enter in scores for different teams.
Then there are different scenes for each team, which display their team flag and their score.
How do I, on loading of each team scene, reference the "Edicion" scene and grab the value entered their team score, to update the score?
I have tried _Edicion., _parent., and _root. and even just Edicion. but nothing works, I keep getting undefined.
Example: _Edicion.teamNameScore.text;
I know how to update the score on the current scene. But just can't grab the score entered on the default scene.
Using flash CS3, how can I locate a use of a movie on the stage? I know if I can see it, I can click it to ID but that is the problem.
View 1 Repliestell me any blackjack reference in AS2?
View 2 RepliesI'm new round here so sorry to open with a question. Flash isn't my area of expertise at all, but if anyone needs help with Photoshop or Joomla then I might be able to help! Anyway - my problem. I had a SWF which interacts with a component SWF. I want to remove the component and replace it with an external SWF. I've created a SWF which contained only the component. I'm then loading that using the following AS2 code:
Code:_root.createEmptyMovieClip("my_ssp", 1);
container._x = 0;
container._y = 0;
[code]....
I have a strange problem, I have a XMLList with elements who have the attribute position from 0 to x. When I want to add text to a element of that XMLList by the following statement, I get a error message:
textElements.(@position == columnIndex) = "anyString";
1050: Cannot assign to a non-reference value.
I was cheating from a sample program to integrate with Flash. I able to add a reference to ShockwaveFlashObjects.dll to my windows app, but What is 1- AXShockwaveFlashObjects. 2- How to add a reference to it, or I have to create it using some tool?
View 2 RepliesI need to pass a variable reference to a function, and have the function change the value of the variable.
So, simplified and not in completely correct syntax, something like this:
function replaceValue(element:*, newValue:String):void
{
element = newValue;
}
[Code]....
Of course, in the replaceValue function, element is a new reference to fungibleValue (or, rather, a new reference to fungibleValue's value). So, while element gets set to the value of newValue, fungibleValue does not change. That's expected but totally not what I want, in this case.
There's a similar question, for Ruby, here [URL]
As the question points out, Ruby has a way to accomplish this. BUT is there any way to do this in ActionScript?
I need to get a pointer to a piece of XML. I can get a pointer to the parent node and everything works but trying to get a pointer to a node that has no children just returns the value of that node.[code]...
Tracing subNode would be just the value and there is no pointer to the original xml object, so editing the subNode var would only change its value, not the one in the original XML object.
How do I get a pointer to the subNode so it can be edited to change the original xml object?
Does anyone know how to extract a class reference from an SWC file? I know I can right click / "Go to definition", and view the class definition. I need to extract these for each class in an SWC. Can anyone provide a method to do so automatically?
View 3 Replies[Code]...
I've learned it reading a tutorial over internet, but I want to know where I can find more samples on how to reference objects in AS3. For future codes, I want to add hitTest and the like.
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 (code)... on a webpage (url).. so that when the value is updated, it would reflect on my roster?
View 0 RepliesIm new to As3 and theres an issue thats driving me crazy. I need to know the name (or reference) of a TextFormat and I cant seem to do it.
Heres some of the code
ActionScript Code:
var f:TextFormat=tf.getTextFormat();
trace ("f.size"+f.size)
trace("****** "+f as String);
Basically I need to find the name of the textformat, which when I created i named like this:
ActionScript Code:
// for example "menuTextSmall"...
var nombreFormato:String = formatosXML.estilo[i].@nombre;
global.formatos[nombreFormato]=new TextFormat();
I have my formats in an xml file with name, attributes, etc. I can get the properties of the TextFormat but I dont know which TextFormat it actually is!!
I have one movie with buttons that has to cause another movie to have a certain action. How do I do this?
View 3 RepliesFirst: I know doodley-squat about Flash. I am just picking it up as I go along.Second: Our whole site is essentially built in flash. The idea is to have a drop-down menu called 'Images' under which will be menu items for 'Pics 1', 'Pics 2', 'Pics 3' etc. When one of these menu items is selected then we need to load gallery.swf.The Main function of Main.as looks like this:
ActionScript Code:
public function Main() {
addEventListener(Event.ADDED_TO_STAGE, addedToStage)
condence onRollOut, onRelease etc code using actionscript 2?
Is there any difference, regarding the memory management, between the following:
Code:
var p:Point = new Point();
doSmthgWithP(p);
Code: doSmthgWithP(new Point()); I don't use this point again after the execution of doSmthgWithP function.
Is it possible to make reference to a variable name rather than the variable value?I have an array full of variables called [int1, int2, int3] and I have defined int1 as 10, int2 as 20 and int3 as 30. I've also got three empty Strings called int1temp, int2temp and int3temp. How would I later make reference to the name of the ints ie. int1, int2 or int3 rather than making reference to the value ie. 10, 20 or 30?
View 1 RepliesBoth websites have around 75 videos on it, fed to them by XML. It's a complete mirror. What I'm looking for is to see if there is a way to only have to change (1) XML to reference both sites. Is there any code I could put into the XML to have it reference another XML on the same server?
[Code]...
I've created a simple class... in the class I have a function which creates a button clip..[code]In the onRelease handler I call the buttonClicked function within the class... however... I can't get it to work. Basically, I don't know how to path reference it. If I say this.buttonClicked() then it is referring to the clip itself instead of the class.
View 2 RepliesI'm working on a set of buttons so that when one is rolled over, it gets larger and the remaining buttons get smaller. This however will all be housed in the rollOver function of the individual button rolled over. So I used an array and a "for loop" to encompass all of the buttons. I am able to reference the one I roll over by simply using "myButtons[i]" but I cannot figure out how to reference all the others using the array.
#include "mc_tween2.as"
var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4];
for (var i=0; i<myButtons.length; i++) {
[code].....