Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
iweiss #1
How add custom properties to built-in objects?
Hi,
I am just migrating a project to Actionscript 2.0 and ran into a problem: In
1.0 I was adding a custom property to XML nodes like that:
myXMLnode.customProp = "hi";
If I do something like this in 2.0 I am getting en error because the property
does not exist in the class. I know how to add custom functions (via
prototype), but how can I add a custom property to the XMLNode class?
I appreciate every help!
Thanks!
Ingo
iweiss Guest
-
Need a custom exentsion built for me.
I will soon be needing a custom extension built for a software program. Where to I post a job such as this? Is this the right forum? Or is there... -
Making Custom Control Properties Visible in Visual Studio's Properties Palette
I am learning how to use the System.ComponentModel class in VB.NET so that I can add my ASP.NET controls to Visual Studio .NET 2003. I have managed... -
Custom TextBox with custom attributes and properties question
I have an webform that has a datarepeater on it. In that repeater I'm binding some data and I have put a textbox control in there. On the... -
activex methods,events,properties and objects
someby knows how to access objects inside activex? I know how to access properties, methods and events, but with objects director returns... -
#24732 [NEW]: Way to lock objects/properties/variables for include
From: nightcat at poczta dot onet dot pl Operating system: * PHP version: 5.0.0b1 (beta1) PHP Bug Type: Feature/Change... -
Laiverd.COM #2
Re: How add custom properties to built-in objects?
You create a class that extends the original class
with
class Yournode extends XMLNode {
var _prop:String;
// constructor
function Yournode(prop) {
_prop = prop;
trace(_prop)
}
public function getProp(){
return _prop;
}
}
In de flash file:
var myNode:Yournode = new Yournode("your prop value");
trace(myNode.getProp());
That should be it basically.
John
--
----------------------------------------------------------------------------
-----------
RESOURCES
[url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
----------------------------------------------------------------------------
-----------
TUTORIALS at
[url]www.laiverd.com[/url]
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------
Laiverd.COM Guest
-
iweiss #3
Re: How add custom properties to built-in objects?
Thanks, John!
The problem with this is that typically nodes aren't created with something
like "new customNode()". I can create a custom XML class "customXML" but if I
access nodes within that object, say "myCustomXMLInstance.firstChild", that
would be always be an instance of the standard XMLNode class and thus don't
have the custom property I need.
It's just like you can't subclass MovieClip by something like "new
customMovieClip()" but you need to attach a library symbol that's associated
with that class instead.
I can't really think of a way to get around that right now.
Ingo
iweiss Guest
-
Laiverd.COM #4
Re: How add custom properties to built-in objects?
Maybe post the question at the flashcoders mailing list. Some pretty good
people there. I'm only starting with the whole as2 thing and don't trust
myself on this already ;-)
John
--
----------------------------------------------------------------------------
-----------
RESOURCES
[url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
----------------------------------------------------------------------------
-----------
TUTORIALS at
[url]www.laiverd.com[/url]
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------
Laiverd.COM Guest



Reply With Quote

