ActionScript 2.0 :: Pass An Xml Node From One Class To Another
Sep 20, 2006
I'm trying to pass an xml node from one class to another and still be able to access that node's properties with no luck. I'll get right into the code for everyone though:
I have an AdvancedDataGrid tree with a ArrayCollection as its dataprovider. Now, for instance, i drag a leaf from one node to another node. To catch the event I'm adding a Listener to dragComplete.
[Code]...
My Problem: I want to know the new node where the leaf was dropped. Actually i would have expected that in the event there is a property like dropParent. This is not the case.
I thought this was going to be easy! I would like to search an XML file for a particular data set i.e. set of nodes depending on a passed variable. However, storing a subset of my XML file via Code:var gallery = this.firstChild; and then searching 'gallery' as you would an array-using a for()-doesn't work since this.firstChild isn't returning an array
PHP Code: function getInfo (){ cardDetails= new Array('v','a','r','i','o','u','s'); var parent_mc:CatProcess = CatProcess(this.parent); parent_mc.addForm(parent_mc.finalCardScreen,cardDetails); parent_mc.removeChild(this); }
this accesses a function of the parent movie clip - addForm which is:
[Code]...
This then adds an instance of the class finalCardScreen before removing itself. I want to be able to pass cardDetails array through to the new screen. I don't know what to put in my addForm object to do this though because I don't want to do anything with it just now, just pass it through to the class that is being attached.
I have seen this code in ultitouch gesture samples. But I don't kno how can I pass a bitmap parameter to the statement [Embed(source="imagenes/prueba.jpg")], how can I use this code with other bitmaps using parameters in this class?
I want to declare a webservice in .mxml and pass it to a function in a separate class. The problem: callresponder's lastresult never gets updated when the call is succesfully made.[code]...
I have an application that gets its variable data in XML file.
This application is used for different clients with different data.
Some of the data I pass to the Document class from the first frame. I would prefer to pass url to the XML file the same way, without the necessity to update the document class. But now I have to hardcode this url in the class every time, because I cannot get parameters from the first frame to the class at once, only after some time (like after loading XML with hardcoded url).
Is there a way to force executing of the code on the first frame before the code in the class will proceed?
I have a main swf that loads different swfs files, one of this swf files is the homepage with navigation items, how can I pass a reference to the loaded home.swf of the main.swf which contains the load methods?
I try creating a var in the home.swf class with the main.swf class type, but the home.swf give me errors that cant find other objects contains in the main.swf
I want a way to pass a string statement from one base class to an other. The two classes are CLICK and READ.What's an easy way to do this? I haven't worked in classes that often to know some of the simple tricks.
I have an array in a timeline that I need to pass to a class file, but I can't seem to figure out how to do this, as the method of inter-class array transfers doesn't seem to work.
I am wondering if it's better to pass an instance of a whole class to another class or just specific properties of that class. For example if I want the height property of class A in class B do I pass just the height value into class B or the whole instance of the class and use classA.height in class B?
I have written a class that works fine, but as soon as I try make it re-usable and pass a parameter. It gives me this error "1120: Access of undefined property xmlList_0."
Here is ActionScript Code: package Classes{ import flash.display.*; import flash.events.*; import flash.net.*; public class Carousel extends MovieClip { [Code] .....
This is the code in my fla.file to run this class: ActionScript Code: import Classes.Carousel; var carousel:Carousel = new Carousel(xmlList_0); addChild(carousel);
Specifies the value of thisObject to be used within any function that ActionScript calls. This method also specifies the parameters to be passed to any called function. Because apply() is a method of the Function class, it is also a method of every Function object in ActionScript. i don't get how "thisObject" is accessible from within the function invoked with it's apply method i'm trying to pass the scope of one class to the function of another so that the keyword "this" in the target function refers to the passed scope or am i misunderstanding the apply() method? it appears to behave differently between as2.0 and as3.0 as well, try this example code from the adobe docs
how i can pass parameters to an instance of a class using the Object.registerClass method. It seems i can only put the name of the class but no extra parameters.
I have a combobox that I need to style with colors from xml. I call this XML file in the same class that has my combobox instance and break out the color I need to a var.
I then use MyCellRenderer (a class that extends CellRenderer) to style the drop down list items like so:
This all works perfectly with a hardcoded color already inside the MyCellRenderer class.
My problem is when I instantiate MyCellRenderer and try to pass the color through I get the following error when I click the combobox open:
Code: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at fl.controls::List/drawList() at fl.controls::List/draw() at fl.core::UIComponent/callLaterDispatcher()
Is it possible to instantiate a class that extends CellRenderer? If not why not?
how can I pass a variable to my custom CellRenderer class?