ActionScript 3.0 :: Accessing Properties Of Embedded SWFs

May 31, 2009

Is it possible to access variables or even functions of an embedded SWF? (One which has been embedded manually and has not loaded from somewhere)For example, I embed an swf called Movie1 which contains a string variable declared in its root, would it be possible for the parent SWF to access that string?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Properties Between SWFs In Different Browsers?

May 18, 2009

My main swf calls in an audio player that I wrote as a separate swf. There's a seek function inside the audio player that skips to any given track in audio player's list, after receiving 2 arguments: artist name and song name. That's semi-irrelevant... but just to keep you updated.

In the parent swf, there's a list of songs, and when clicked, each song will pass those 2 arguments to the audio player swf's seek function. The problem is simple enough to explain:

In the Flash test, it works fine. In IE it works fine. In firefox, I click the song button, and nothing happens. The audio player still works fine, but I can't seek to other songs from the parent swf.

View 1 Replies

ActionScript 3.0 :: Accessing An Object Through One Of Its Properties?

Jul 7, 2011

I'm doing some work with JSON in as3 using as3corelib (very useful) and was wondering if it is possible to get an object if all you have is one of its properties, also an object. Here's an example of some JSON:

"parentObject": {
"propertyObject": {
etc.
}
}
so what i'm asking is, if I have propertyObject, can I access parentObject somehow?

View 2 Replies

ActionScript 3.0 :: Accessing Properties From Another Package

Oct 23, 2011

I am working on setting up some simple AI actions for my enemy class in the game that I am working on, but I am having trouble accessing the player's X location within the enemy package to set up a detection function. I have defined the player on my Level package along with the enemy, and I defined the player's and enemies X and Y locations within the Player/Enemies package respectively.

Within my flash file I have linked to my Level.as file. Also within my flash file library I have two movie clips. Both have a square in them that are the same size but colored differently. One is called PlayerSpriteMC and the other is called EnemiesSpriteMC.

[Code]...

View 1 Replies

ActionScript 3.0 :: Accessing Another Class's Properties From A Different One?

Jul 1, 2009

I have two movie clips on the stage at frame 1 and frame 2. Both are instances of seperate classes. (They are not dynamically created, just their linkage is set to their class names)I have created soundChannel and Sound Objects in Class 1 and I want to access them from Class 2. (I want to stop the sound channel that was started in class 1)Is there any way to do this? If yes, will this be true for other properties also?

View 7 Replies

ActionScript 3.0 :: Accessing Parent Through One Of Its Properties?

Jul 6, 2011

I'm doing some work with JSON in as3 using as3corelib (very useful) and was wondering if it is possible to get an object if all you have is one of its properties, also an object.Here's an example of some JSON:

ActionScript Code:
"parentObject": {
"propertyObject": {

[code].......

View 2 Replies

IDE :: Accessing Object Properties On A New Frame?

Apr 25, 2009

I'm having trouble accessing objects on new frames.On frame 1 I have:

Code:
var HelloWorld:Object = new Object()
On frame 2 I have:

[code]....

View 3 Replies

ActionScript 3.0 :: Access Methods / Properties Of Embedded Swf?

Feb 11, 2012

Access methods / properties of embedded swf? [code]...

View 7 Replies

ActionScript 3.0 :: Accessing Methods And Properties Via GetChildByName

Dec 2, 2007

I seem to be having a bit of a problem here. I'm generating a load of class instances using the following code:

maxpersons=25;
for (var i:Number=1;i<=maxpersons;i++)
{
var person:Person = new Person;

[Code].....

OK. I then need to run through each of them and check for a collision with an object from the main stage (called redDot), which I pass to a method (called doDamage) within the class. I'm using the following code:

for (i=1;i<=maxpersons;i++)
{
if (game.getChildByName("person"+i).hitTestObject(red Dot))
{
game.getChildByName("person"+i).doDamage(redDot);
}
}

I keep getting an error saying "1061: Call to a possibly undefined method doDamage through a reference with static type flash.displayisplayObject."!

It just won't work. I've tried altering the code to:

game["person"+i].doDamage(redDot);

but I get an unexpected trace output saying "TypeError: Error #1010: A term is undefined and has no properties."

View 6 Replies

ActionScript 3.0 :: Accessing Properties Of The Document Class?

Nov 14, 2009

when I try to access a property of the document class from another class, I get an error:

Quote:

1119: Access of possibly undefined property _left through a reference with static type flash.displayisplayObject.

Maybe I'm not doing it correctly? This is how I've been accessing document class properties so far. Does the fact that they're private make a difference?

Quote:

root.property

View 1 Replies

ActionScript 3.0 :: Accessing Properties Of External MXML?

Sep 16, 2010

I have written "components" in external .mxml files like dialogs and such. For example, GamePropertiesDialog.mxml. These components are used by another file, Main.mxml for example. If I instantiate a GamePropertiesDialog I am unable to access its pieces like a textbox with an id of GameName until AFTER I add the dialog to the display list.Doesn't work:

Actionscript Code:
var tmp:GamePropertiesDialog = new GamePropertiesDialog();tmp.GameName.text = 'test';addChild(tmp);

Does work: Actionscript Code:
var tmp:GamePropertiesDialog = new GamePropertiesDialog();addChild(tmp);tmp.GameName.text = 'test';

View 1 Replies

ActionScript 3.0 :: Document Class, And Accessing Properties?

May 25, 2009

I'm currently working on an interactive app, (site) which requires me to modify a few textfields, and change images dependant on the user choice (using mouseevent). This is a separate module, thus I'm posting the question in here instead:there are three images, that are lined up, with a textbox next to them. When a image is chosen, and enlarges, the text changes with the chosen image, according to XML.The textFields, 'text_title', 'text_description' are contained in a movieclip, called 'textbox'.This has been built in the Flash IDE (CS3) named info.fla/swf, which refers to a Document class 'com.info', made in Flex Builder 3...I attempted to modify the textfields using this:textbox.txt_title.text = "Loading";textbox.txt_desc.text = "test";But, I was unable to at first to change the text using the document class, as it gives "1120: Access of undefined property <variable>".

View 3 Replies

C# :: - Accessing Object Properties From String Representations

Mar 19, 2010

In actionscript an object's property can be accesses in this way: object["propertyname"] Is something like this possible in c#, without using reflection?

View 2 Replies

ActionScript 3 :: Accessing Properties Via String In Object

May 1, 2011

I have an engine I created a while back that loads objects into a container based on XML data. A really quick example of the XML would be like this:
<level>
<object cname="enemies.Robot">
<pos x="200" y="400" layer="mobiles" />
</object><object cname="Player">
<pos x="12" y="89" layer="mobiles" />
</object></level>

I have a class Environment that has a method loadLevel(data:XML) which I parse the XML through, then the function runs through the XML finding all object nodes and uses getDefinitionByName to determine which Object I want to create based on object.@cname. From here, I have to manually define each property based on the XML like so:
obj.x = xml.pos.@x;
obj.y = xml.pos.@y;
etc.

I was wondering if there's an inbuilt method for setting a property based on a String. By this I mean something like so:
var mc:MovieClip = new MovieClip();
mc.someInbuiltFunctionThatSetsAProperty("alpha", 0.5);

This way I could change my XML to be more like so:
<object cname="Player">
<props>
<x>200</x>
<y>221</y>
<alpha>7834</alpha>
<health>Something</health>
<power>3</power>
</props></object>

And iterate through all the children of props to set all of my properties on the fly. I know if I create an Object and set properties within it like so:
var obj:Object = {
var1: "hello",
var2: "there",
name: "marty"
};

That you can then iterate through names/values using the for(String in Object) loop like this:
var i:String;
for(i in obj){
trace(i + ": " + obj[i]);
}
/**
* Output:
* var1: hello
* var2: there
* name: marty
*/

Surely there's a way, as here's an example of identifying a property using a String:
var ar:Array = [new MovieClip(), new MovieClip()];
ar.sortOn("alpha", Array.ASCENDING);
So just to make my question more to-the-point: I want to be able to get and set properties that I can identify using a String.

View 2 Replies

ActionScript 3.0 :: Accessing Some Properties Of A Custom Component?

Jan 15, 2009

I have been stuck on this problem for a while, and wonder if anyone knows the answer. It is concerning accessing some properties of a custom component. I marked the problem with the keyword [PROBLEM] in the following snippets of code.

components/State1UI.mxml
--------------------------------
<?xml version="1.0" encoding="utf-8"?>

[code].....

View 0 Replies

ActionScript 3.0 :: Accessing Properties Of The Stage From A Class?

Aug 29, 2009

I am trying to access the x and y properties of the stage so I can set an objects' x and y properties to place it on the center of the stage:

this.x=stage.stageWidth/2;
this.y=stage.stageHeight/2;
The call to instantiate the object(*.fla):

[code]......

View 4 Replies

ActionScript 2.0 :: Accessing Properties Of Movie Clip?

Apr 26, 2010

I have the following prob :

I created several instance of the same MC like this

[Code].....

View 1 Replies

ActionScript 3.0 :: Accessing Properties And Methods Of External SWF

Oct 2, 2011

I can't access the props and methods of an external AS3 swf after it's loaded by Main.as. Here's a very simplified version of the code for Main.as (the calling swf):

Code:
package{
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.display.Loader;
public class Main extends Sprite{
private var imgLoaded:Boolean = false;
[Code] .....

View 5 Replies

ActionScript 3.0 :: Accessing Properties From Stage In A Class?

Feb 28, 2012

I am trying to access a property that belongs to the stage, from a class. For example, let's say I add a textfield with an instance name of "magic_txt" on the stage. In the Document Class, I am able to access magic_txt and update the field like so:

magic_txt.text = "Magic Text"

However, since I would like to work in classes, I am having a difficult time figuring out how to access the property "magic_txt.text" from a class. I know I need a reference, but I am unsure how to set this reference.

I am coming from a strong background in Visual Basic, and in Visual Basic, the way to access a form property is to call the form name (dot) object. In actionscript, it doesn't seem to be as simple.

View 9 Replies

ActionScript 2.0 :: Accessing Object Properties Dynamically?

Jun 21, 2007

I have a custom property called Player (like a basketball player) that has properties for points per game (ppg), rebounds per game (rpg), etc.I'm designing a piece where users can get averages and compare players across many different categories.

I have a String variable "stat" that tracks which property they want to compare. I can use "stat" in a sorton function, but need to use it to access the object property. So when the user chooses "ppg" or "rpg" i can access Player.ppg and Player.rpg by using the stat variable. Player.stat doesn't work.

View 2 Replies

ActionScript 3.0 :: Accessing Properties For An Mc In An Externally Loaded Swf?

May 24, 2010

I am trying to set a couple of properties (specifically width and height) for an mc within an externally loaded swf but am having bigtime troubles. Keep getting the 'Error #1010: A term is undefined and has no properties'. The code is attached below. I have tried to figure this out and searched for solutions but could not resolve this myself.

import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;

[code]......

View 1 Replies

ActionScript 3.0 :: Accessing Object Properties Dynamically?

Jun 27, 2010

hat is the correct way to access an object dynamically? I have tried this with no success:

Code:
i += 1;
var myVar = this[myObject. + "myProperty" + i];

[code].....

View 3 Replies

ActionScript 3.0 :: Communicating With Embedded Swfs?

Sep 7, 2010

So if I have several external swfs embedded in one big one, in what way can I communicate between them?Specifically,

-the main swf needs to know when buttons have been pressed in an embedded one, and it needs to tell all the other embedded ones about it.

-the embedded swfs need to intelligently resize and shuffle around each other, while keeping their coordinate origins in the top corner.How do I go about this?

View 17 Replies

ActionScript 3.0 :: Communication Between Embedded Swfs?

Jan 26, 2010

I have a main swf that embeds another swf. I want to be able to tell the embed swf to do something.

Main.swf
[AS]
//Creates new image loader
var imageLoader:Loader;
//Holder variable for the image to load

[code].....

View 1 Replies

ActionScript 2.0 :: Accessing (Nested) Component Properties From Class

Jul 29, 2009

(Actionscript 2 btw - and actually cs4, not that it really makes any difference?) I have a class that instantiates a movieclip from the library, e.g.:
Code:
debugbar:MovieClip = thing.AttachMovie("debugbar", "debugbar_mc", 999);
So attaching it to the where ever "thing" is - could be movie clip or level0 or whatever, doesn't matter as "debugbar" is a private variable of the class. Now the important part - debugbar in the library is a movieclip that contains some components - buttons and textInputs. The problem comes when trying to access these components.

I would have thought that this would work:
Code:
debugbar.input_txt.text = "hello";
In order to set the text of "input_txt", the instance name of a TextInput component on the timeline of the movie clip (put there in author time). However, this does not work. Infact, I cannot access any specific "component" properties - they come back undefined. I can however set and retrieve MovieClip properties for the "input_txt", such as _x. However there is one added strange thing with this too - setting _visible to false doesn't seem to work (however perhaps a component by default overrides this).

I also appear not to be able to add event handlers to the component - at least for the usual component events. I tried casting it to a component, such as:
Code:
var temp:TextInput = TextInput(debugbar.input_txt);
trace(temp);
which gave "temp" as null.
However if you trace the thing itself without casting to what it is, it gives the path to correctly. It almost seems like the components are somehow broken when trying to access them this way - or that they cannot be accessed this way?

The thing is, I was able to access all of this before, when the code to do it was placed on the timeline (frame 1, the only frame) of the debugbar itself, where the components were child instances. This meant I could just reference them directly too - so input_txt rather than debugbar.input_txt , although that is probably largely irrelevant. I need to have it in a class though, as I need to pass in certain objects that need to be accessed by the mc.

View 2 Replies

ActionScript 3.0 :: Accessing Child Properties Of Items In A Container?

Jun 8, 2011

Basically, I have a menu created using XML. Each menu item has a fill that fades in and out as the user scrolls over them. What I want to happen is that when an item is clicked, it stays highlighted. The problem comes when I click on the second item. I can't get the first item to "unselect."Here is the menu code and functions.

Code:
var menuHolder:MovieClip = new MovieClip();
menuHolder.x = myMask.x;

[code].....

View 6 Replies

ActionScript 3.0 :: Accessing Movieclip Properties Which Are Created During Runtime?

Mar 9, 2011

how to access the properties of the movieclips which are created during runtime.

Ex:
var dotCount:uint = 0;
for(var i:uint = 0; i<=10;i++)
{
var circle:MovieClip = new MovieClip();

[Code]....

How can I access a property (say .alpha or any other property) of "circle6"??

View 2 Replies

ActionScript 1/2 :: Controlling Embedded Captivate SWFs

May 25, 2006

I have a SWF (SWF A) that I'm loading into a movieclip (Movieclip C)which is part of another SWF (SWF B). Basically, SWF B functions as a player, with play and pause controls. These controls control Movieclip C where the external SWF A is loaded into.Normally, I have had no problem with this and it always works. At run time, when you click the pause button on SWF B, a stop() command is issued to Movieclip C, which stops the play of
the external movieclip (SWF A) loaded into it.However, I did a screen capture with Captivate and published it as a SWF. I loaded this SWF (SWF A) into Movieclip C in SWF B at run time. However, clicking the controls on SWF I created has NO EFFECT on the SWF I created in Captivate. It just keeps playing.I guess all SWFs are NOT created equal. How can I make this work?

View 4 Replies

Professional :: Integration Of Swf With Embedded External Swfs In Dw

Jul 6, 2011

I have a flash file, which I am using as the index for my site. Into this flash file, I have an external swf that loads for an introduction. In this external swf, the as is set up so as to be a full browser, scalable slideshow. The index swf has a horizontal menu bar, from which other external swfs can be loaded. As a side note, I don't know if this is indicative of something... the preloader also does not want to work with the externally loaded swf, but will work when a dummy photo placed in the main swf file.

When I bring this into dreamweaver, the swf that was loaded into the index swf is no longer full browser, allthough it works when I preview (ctrl + enter) from within flash. It does not work from within flash when I hit f12. Yes, the html wrapper is exported at 100% width and height. All the files are in the correct place, within the same folder. Also, the preloader doesn't work but it wasn't working from within flash with an externally loaded swf. getting a full browser flash external swfs to work once the main index swf is brought over into dreamweaver?

View 3 Replies

ActionScript 3.0 :: Call Functions In Embedded SWFs?

Apr 20, 2009

I am embedding a number of SWFs in my main Flash movie, and I need to call functions within those SWFs.This is no problem when loading the SWF as an external file, but when I use the [embed] directive to embed the SWF directly into my app there seems to be no way to access the functions?I tried numerous approaches, including waiting for the embedded SWF to be added to the stage, but it seems it just does not allow access. And unfortunately in my case, loading the SWFs separately is not a good solution.

View 2 Replies







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