ActionScript 3.0 :: Pb Passing Name Of Loaded Object?
Nov 9, 2010
I create dynamically movieclips, each one filled with an image from a list by importing an XML file.I colorize each movieclip at runtime.This works fine.I need to be able to reference which image is what movieclip so as to export pairs of image name / color value.I tried adding a counter and naming the movieclips inside an onComplete eventListener, but the loading is not sequential and I get random results.
View 0 Replies
Similar Posts:
Oct 28, 2010
My swf requires the path to an xml file in order to run. Currently this is passed in from html as a FlashVar using swfobject.But - in certain situations, the swf will be loaded by another swf. How do I pass in FlashVars using a Loader?
View 1 Replies
Jun 29, 2008
so I have menu.swf that uses loadClip to bring in data.swf
Depending on what button is pressed I want menu to read menuHeight = 4600; from data.swf
in data swf I declare the var as _root.menuHeight = 4600;
and in menu.swf I try to read it as normal. menuHeight.
Shouldnt this work since the _root. of data.swf is the _root. of menu.swf?
View 2 Replies
May 15, 2011
i have a swf file that i am loading into a parent movie and i need to pass some variables to the loaded movie, unfortunately i do not have the original fla file of the movie being loaded in so i cannot use _root or _global ect..the swf that is being loaded in works fine and originally intended to have the variables passed though flashvars, is there any way i can pass these variables though the parent without having to change the fla of the loaded in swf
View 1 Replies
May 3, 2010
I can call this external swf when i use loadmovie on a button function
Actionscript Code:
ytLoadBtn.onRelease = function(){System.security.allowDomain("http://www.reverbnation.com");videoLoader.loadMovie("http://cache.reverbnation.com/widgets/swf/40/pro_widget.swf"); };
However i can't seem to pass the flashvars as variables within the url string or as loadvariables
Actionscript Code:
id=artist_763698&posted_by=artist_763698&skin_id=PWAS1008&font_color=333333&auto_play=false&shuffle=false
View 1 Replies
Sep 14, 2009
how can i pass flash vars to a child.swf file which is getting loaded into a parent.swf file. Thparen.swf file is running locally
View 6 Replies
Jan 30, 2011
how can I pass variables to externally loaded SWF written in AS2 ?
View 0 Replies
Jun 26, 2007
I'm working in a modular app and I'm having trouble passing variables between a Parent and it's loaded Child SWF file. The Child SWF has a single object called hotSpot_mc. The Parent has a frame called frame_mc to load the Child. I'm trying to pass the value of bHotSpot, which is turned on and off when the user mouses over the MovieClip. Testing shows that the value is being set in the Child but not in the Parent, where it remains undefined. Should I be using shared objects or do I just have to use better targeting?
Here is the parent SWF
Code:
// Load the child SWF into frame_mc
loadBackground("Room_1.swf");
function loadBackground(backgroundName:String):Void {
[Code].....
View 1 Replies
Dec 25, 2008
I have a flash mp3 player that loads its info from an xml file and it works great. Im trying to load this same player onto another website and have changed the domains, xml info, etc to load new songs. I want to have this swf be integrated into a larger site and not just loaded at the bottom of an html page. Heres the player working: [URL] On the new site, I have a target movieclip named mp3player and is the same dimensions as the loaded swf is supposed to be. On frame 1, I have a loadmovie() and then a loadVariables() and I have copied/pasted the flashvars from the working html page into the loadVariables(). The site is loading the swf, but not seeing the flashvars. The swf is loading way zoomed in on the image that is supposed to be 120 120
View 1 Replies
Sep 7, 2009
i'm passing a xml from my flex app to a loaded Flash swf. I'm trying to get the data from the xml using e4x. But I can't seem to get this trace to show what I want The problem is the namespaces I think.
[Code]...
View 3 Replies
Aug 31, 2010
I have a loaded swf that passes parameters [code]I am able to get the first parameter (next) but not the xmlPath.in flash, i tried these two:[code]
View 1 Replies
Jul 13, 2011
Then there is an external SWF that is loaded by main.swf. I am trying to get this external SWF to check the value of "myVar" and depending on what the value is, send the playhead in the main.swf to a certain frame. have it almost working, but it is giving me problems. And I am not sure it is the best way to do it.On the timeline of main.swf is a movieClip called "BG". It has 6 frames. the first frame declares that variable, and each of the other 5 frames, set the value of it. I need the external swf to check the value of "myVar" to detemine where to send the playhead of the mian.swf. So on a frame in the external SWF, I have this code:
Code:
MovieClip(parent).addEventListener(Event.ENTER_FRA ME, fl_EnterFrameHandler); function fl_EnterFrameHandler(event:Event):void { dispatchEvent(new Event("myVar_value", true)); }
[code]......
View 13 Replies
Sep 4, 2008
i am using flash cs3,i have a main movie that load many swf using a document class..i need to pass "userid" variable from the main movie to loaded swf so they can change their content dynamically.
View 7 Replies
May 7, 2010
I have a movie clip where I store a value in a variable called "yourname" and then load a different .swf file in level 1. I display the value of "yourname" in a dynamic text box, that works fine. I then move on to a frame where the user has an input text box and can re-enter a value for the "yourname" variable, and then clicks a button symbol to reassign the value. Bear in mind, "yourname" was not originally stored on this level and this movie clip, it is stored on level 0 on the first (main) movie clip. Here is my code in the button:
on (release) {
_level0.yourname = String (inpt_newName.text);
}
inpt_newName is the input text box. My intent here is to have a "main" timeline where variables are stored, and then load and unload various .swf movie clips as needed, storing and variables (i.e. decisions) that the user makes.
View 1 Replies
Jul 30, 2011
I have a loaded swf (CustomClass) and I want to listen a dispatch event from the swf, but it doesn't seems to work. The relation of the dynamic class are:
Code:
tablet(DocClass of the swf) ---> mainmenuC
I'm trying to pass a event to a function in tablet, and have the codes listen to the dispatchEvent from the function in tablet.
ActionScript Code:
CustomClass.addEventListener("profile_home", currentPage)
private function currentPage(event:CustomEvent):void {
trace("profile home clicked")
} tablet.as
[Code] .....
It doesn't return any error, but why does it not pass the data?
View 2 Replies
Apr 27, 2011
This has been driving me nuts. The short of it is that I have a main movie that loads smaller swfs. In the main movie, there is a textbox that holds descriptions of the smaller clips.What I am trying to do is this: When the user clicks a button in the loaded swf, a string variable "feedback" replaces the text in the description text in the parent clip.Here is the code I have. I have been searching this for a while now and have tried various things, so this may be way off base. The clips load fine and everything, I just can't figure this one piece out.I am only showing the relevant code because there is a LOT of other working code. If anyone needs more info, let me know.Main Clip
Code:
clipLoader.contentLoaderInfo.addEventListener( Event.INIT, onLoaderInit );
function onLoaderInit( e:Event ):void {
[code]....
View 5 Replies
Mar 2, 2007
I can't seem to load a movie clip, and then pass some variables from that loaded movie clip back to through stage_mc it is loading into - to the SubClip.
The structure is as follows:
Main
>SubClip
>>Stage_mc
Where the new movie clip is loading into stage.
I need to pass two variables from the loaded clip into the SubClip. Simple vars to fill some dynamic text in SubClip.
I've done the whole _root.myvar thing, _parent, and _global.
View 5 Replies
Mar 14, 2011
I just saw a flv player that was done in AS2.I wanted to know whether it's possible or not and how I could pass the needed flashvars, params and attributes to the flv player (swf file) once I load this flv player in a movie clip with the method loadclip.
View 0 Replies
Feb 21, 2007
i'm pulling my hair over this. i have sucessfully (verified) loaded an xml file and can trace the data i'd like to pass. i am loading the external swf into an empty mc called X. in the external swf i am loading is a mc and in there is a dynamic textfield. i give the content of the xml to the path to the dynamic textfield and nothing happens. trying to pass the variable with: target.text = content;
i listed the variables and objects in the test movie debug option (command+enter) and i can see the dynamic text box variable. then i took copied the path from the output window to my actionscript, replaced _level0 with _root but still to no avail. what am i doing wrong? do i have to publish the swf being loaded in a certain way? why am i able to look at the variables in the debug list variables and objects option, but not in the actionscript?
View 1 Replies
Jan 17, 2010
I have a function that goes like this;
Code:
function goback1(event:Event) {
cont.nums.y=86.5;
[code].....
View 1 Replies
Aug 3, 2011
I am building flex application and using blazeDS to pass objects between java and actionscript. I have the following java classes (Property that extends BaseProperty) and their actionscript representation. When I pass the java Property object to the actionscript using blazeDS and trying to cast it as action scipt BaseProperty object I get null. Why? It's important to mention that if I cast it as Property everything is fine.
View 1 Replies
Sep 30, 2011
I am working on a side-scrolling platformer game. Because of this, I have a class that acts as a floor. I also have a class representing enemies. I am having problems with passing a parameter to a custom class' constructor. The class (SkullDemon.as) extends MovieClip. I am trying to pass an instance (called "floorL1") of a customer class called "FloorLevel1." "FloorLevel1" also extends MovieClip (I do not have a written .as file for "FloorLevel1"; I just exported the floor MovieClip to that class).
I am trying to pass an instance of "FloorLevel1" so that the "SkullDemon" object can land on the floor just like in a platformer. My main class is called "TME2_Main." This is the class from which I try to pass the "floorL1" instance to the "SkullDemon" class. This is how I try to create a Skull Demon instance and pass "floorL1" to its constructor:
[Code]...
What am I doing wrong here? I have spent a while looking for solutions (including moving code outside of TME2_Main's constructor),
View 1 Replies
Dec 27, 2011
I'm trying to set 2 object each with different data, and pass it into another function as parameters, but when I trace for the data in the object, I can only get the 2nd object data. Seems like the 1st object was replaced by the 2nd object.
[Code]...
View 1 Replies
Feb 22, 2011
I just started using object pooling and I have some problems with passing arguments. I made class "Circle" which needs 3 arguments when instanced and I try to push it into the pool.
[Code]....
View 4 Replies
Apr 11, 2011
So far, I have a class that creates a Vector object, and pushes data into it:
ActionScript Code:
public var mList:Vector.<cusClass> = new Vector.<cusClass>();
The data is read by a second class like so:
ActionScript Code:
trace(firstClass.mList);
The problem Im having is take that same Vector and passing it into a third class (from the second class) as an argument in a method: ActionScript Code: views.mUpListing(firstClass.mList);
[Code]...
View 2 Replies
Apr 27, 2011
I keep getting this error #2007 i want to parse the stage and pass a bullet object to a class function that function is called every ENTER_FRAME in the class itself
because the bullet object is added to the stage and on the bullet, there is a event listener to call a function in a class every ENTER_FRAME
but now i want to delete this bullet as it leaves the screen on the top because bullets in this game can only fly upward.
this is some of the code so far in the class itself:
ActionScript Code:
package classes {
import flash.media.Sound;
[Code].....
View 5 Replies
Jan 13, 2012
I want to pass these two parameters to js function 'eventaction':
Code:
name: 'go'
params: {}
[code].....
View 1 Replies
Jun 16, 2004
I'm having troubles activating the HitTest, passing the objects name as a parameter through a global function. Let's say there is the following function on the main timeline:
Code:
_global.fallIntoBasket = function (fallingObject) {
if (_root[fallingObject].hitTest(_x, _root.basket_mc._y+(_root.basket_mc._height/2)-7, true)) {
trace ("teste");
_root[fallingObject]._alpha=0;
}}
I then call this function passing the this._name of the object as a parameter in a onClipEvent (EnterFrame) on each of the falling Objects action box. The whole detection thing doesn't work though... but if I place the hitTest code on each of the object, and change the _root[fallingObject] to this it works. Can I not pass hitTest through a function?
View 3 Replies
Dec 18, 2009
A brief overview:
1. I am working on a project in ASP and I am making queries to a SQL db that returns data back in the form of xml. I am not in control of the db or how it returns data.
2. I process the XML within the ASP page and then I also process the data from within flash. I am therefore making two database calls for one page view.
3. I am trying to figure out if I can in anyway, pass an XML list from the page to flash so that I am making only one database call. The site is heavily hit and I am practically doubling the server load. Basically, the only way I think that may be possible is through javascript but not sure where to begin.
View 2 Replies
Mar 23, 2010
I have isometric tiles that are put together to form a map. Because the graphics are isometric, and the images themselves are rectangles (with transparent corners) I was wondering if there's way to pass a mouse event through image being clicked if it's being clicked at a point that is transparent onto the object that is layered below it. Using the bitmapData class I already know how to check if the position being clicked is transparent or not, just not the second part.
View 3 Replies