XML Object shorter properties and method names

XML Object shorter properties and method names

Post by slamdunkinpoo » Thu, 15 Jan 2004 14:51:34



It would be good if shorter names were available for XML object properties and methods as an alternative.

The long Method names increases flash file size which is a big disadvantage when creating flash application for devices. Since FP interprets code only at runtime, so having shorter Method would be good. Even FP scanner/lexar will have less load.

e.g.

_level0.xObj.firstChild.firstChild.appendChild(node);

should be converted to something like :

_level0.xord.xfc.xfc.xac(node);

less typing ;)

firstChild ~ xfc
appendChild ~ xac
createElement ~ xce
createTextNode ~ xctn
.....
etc.

Do you think having something like this will be good on performance?

 
 
 

XML Object shorter properties and method names

Post by hayde » Thu, 15 Jan 2004 23:00:48


if you prototyped these new properties and used them in a SWF how would you test if there is a performance difference between the new properties and the conventional properties?

Would using getTimer() to determine how long it takes Flash to parse XML with one or other set of properties be a useful measurement of performance?

http://www.aviarts.com - web developer and flash developer
http://www.sonify.org - interactive sound for the web and mobile devices.

 
 
 

XML Object shorter properties and method names

Post by slamdunkinpoo » Fri, 16 Jan 2004 15:01:54


Good idea. The immedgiate performance would be that the final swf file size will be small,
less memory leak, less typing and no long lines of code so no need of horizontal scroll bar in IDE.

I'm not sure if the overhead of prototyping will affect performance.

 
 
 

XML Object shorter properties and method names

Post by hayde » Sat, 17 Jan 2004 00:04:51


-----
The long Method names increases flash file size which is a big disadvantage when creating flash application for devices. Since FP interprets code only at runtime, so having shorter Method would be good. Even FP scanner/lexar will have less load.
-----
ok, I did not read your post as closely as I should have.

#1 When you compile a SWF, the IDE converts all ActionScript into byte code.  (Theoretically you could code a Flash movie using any programming language as long as you can convert to it to Flash supported bytecode). Flash does not parse code at run time, unlike a web browser model that parses and runs JavaScript after the file loads.  So the file size of the byte code is probably not affected by the number of characters in a given ActionScript object name.  The compiler just parses your ActionScript and matches the corresponding object with its appropriate bytecode and creates the SWF.

#2 with this in mind, if you did prototype the objects you might actually add some file size overhead because you are adding extra byte codes for the prototypes. I dont think the prototyping should add significantly to the performance, but you never know on a CPU limited device.

#3 it might make the FLA smaller, and is definately easier to type.

http://www.aviarts.com - web developer and flash developer
http://www.sonify.org - interactive sound for the web and mobile devices.

 
 
 

XML Object shorter properties and method names

Post by slamdunkinpoo » Sat, 17 Jan 2004 09:19:54


#1
When I open a 'swf' file in hex editor or in Textpad I see all actionscript code (minus comments) including long xml method names.

check the links below

http://chattyfig.figleaf.com/flashcoders-wiki/index.php?ASNative

http://chattyfig.figleaf.com/flashcoders-wiki/index.php?ASSetNative

http://chattyfig.figleaf.com/flashcoders-wiki/index.php?Undocumented%...

 
 
 

1. Passing XML Object to CFC Method

I generated an XML Document Object using CFXML and it seems to work fine until
I try to pass it to a CFC method with an argument type of "xml".  The docs say
that xml can refer to either an xml object or xml string; however, when I try
to invoke my CFC, it seems that CF8 is assuming it is an XML string and
attempting to parse it, which fails because it is already parsed!  The error is:

 An error occured while Parsing an XML document.
 Content is not allowed in prolog.

 If I do a toString() to start with, it seems to work - so are the docs
incorrect?  Must "xml" type be an XML string only?

2. Thanks Massimo!

3. Call method from within xml object

4. odd projecter behaviour on win95 laptop

5. xml object properties firstChild, nextSibling help?

6. Help-scrollable list with pictures

7. Object/Properties panel does not display object properties

8. Director Virtual Memory

9. XML element names vs CF variables names

10. Properties Panel does not show object properties in pane below tabs

11. forms - post method - field names

12. Empty object properties when sending object from Acrobat to WebService in javascript.

13. setting properties of a class using a method