Re: [Flashcoders] Flash CS3 Prof copy: missing Tree component.

2007-06-07 Thread Scott Whittaker

Hi guys,

I haven't had a chance to delve into using AS3 yet, and I know the AS1 and
AS3 runtime engines in the Flash 9 player are totally seperate, but is it
not possible for AS2 movies to share data with AS3 at all? Surely an AS3
movie can load an AS2 movie into itself and access it's properties? If so
then it should be possible for an AS3 project to use an AS2 movie with
remoting components and use movieclips for data storage and communication?

It would be poor use of OO coding skills, but technically feasible and much
less effort than re-engineering the components. And along those lines, isn't
it possible to reverse-engineer the AS2 components with a decompiler, and
rewrite the code in AS3?

Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Launch flash player / web browser from ANT on Mac OS X

2007-06-07 Thread Scott Whittaker

Hi guys,

I've sussed a reliable build solution for launching apps from an ANT task.

First, declare some variables which hold paths to your app:

   property name=webBrowser location=/Applications/Firefox.app//
   property name=flashPlayer location=/Applications/FlashPlayer.app//

Then use the OSX open command as the executable, and pass it both the app
and the file as arguments:

!-- LAUNCH HTML --
   target name=launchHTML if=html.exists
   echo message=Launching ${html}/
   exec executable=open dir=. spawn=true
   arg line=-a ${webBrowser} ${deploy_dir}/${html} /
   /exec
   /target

   !-- LAUNCH FLASH PLAYER --
   target name=launchPlayer unless=html.exists
   echo message=Launching ${out_swf}/
   exec executable=open dir=. spawn=true
   arg line=-a ${flashPlayer} ${deploy_dir}/${out_swf} /
   /exec
   /target


Of course this means you need to define an app to open the file with instead
of relying on open to use the default app, but it works!

Now we just need a better version of ASDT...

Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] [ot-ish] Font customization (will pay $ for help)

2006-12-03 Thread Scott Whittaker

Hi Josh,

One thing you could try is to keep your special symbols in a seperate font
and use HTML formatted text - I assume you are already using HTML text
anyway if you include the fonts in different styles. So when you need to
display your special symbol, you simply change the font in the HTML using
the font tag.

I have used this method to embed mathematical and chemical symbols in an
HTML textfield along with a more standard multi-style font.

Save you some time and money? ;)

Scott

On 03/12/06, Josh Santangelo [EMAIL PROTECTED] wrote:


One of my projects requires the use of some specific dingbat symbols
in the middle of text. These symbols are custom artwork which I have
in a vector format. I can't just put them in as img tags in an HTML
text field, because you can't do inline images in HTML in Flash.

The site uses one font, and three weights of it -- normal, bold, and
italic. I asked a friend who is a type designer to insert these
symbols into the fonts and export them back out as TTF files. Worked
great, except for one weird quirk. With one of the fonts installed at
a time, they work fine. With them all installed, they take on each
other's characteristics somewhat randomly in Flash -- normal will be
bold, bold will be italic, italic will be normal -- what they do
seems to depend on the order in which they're installed or something.
This is on Mac.

So: I'd like to provide someone with the original fonts, the revised
fonts, and the symbol artwork and get a set of fonts back which work
correctly in the Flash 8 IDE on OS X. In exchange I can pay some fair
amount of money or provide an equivalent favor of some kind. Anyone
up for it?

thanks,
-josh
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Overridden methods not called - AS2 bug?

2006-11-30 Thread Scott Whittaker

Hi guys,

I'm having a curious and somewhat annoying problem using overridden methods
in a subclass. What I am trying to do is extend the XML class into a new
XMLDocument class and the XMLNode class into a DOMNode class in order to add
some useful extra methods such as getElementByID, getElementsByTagName and
the ability to produce a customisable object map of any DOMNode. All of this
is working for the most part.

The reason I am extending the XML classes in this way is so I can get the
most out of the speed and functionality of the intrinsic methods, remain
compatible with other scripts designed to work with regular XML objects, and
take advantage of my custom methods for accessing and manipulating XML
without going for a heavyweight solution like XPath.

The constructor to create an XMLDocument composed of DOMNodes is like this:

   public function XMLDocument( source:String ) {
   super();
   parseXML( source );
   }

   public function parseXML( source:String ):Void {
   super.parseXML( source );
   var document:DOMNode = convertNodes( this.firstChild );
   this.firstChild.removeNode();
   this.appendChild( document );
   }

So the XMLDocument is initialised with the default constructor and any
source string is passed along to the parseXML method to build the regular
XML structure. Next, the childNodes are converted from XMLNodes to DOMNodes
using the convertNodes recursive method. Actually the XMLNodes are not
converted as such - the information within them is used to create new
DOMNode instances and the structure recreated with the
DOMNode.appendChildmethod (which accepts a DOMNode argument and simply
passes it along to
super.appendChild ). Finally, the original XML tree is removed and replaced
with the new DOM tree.

The resulting XMLDocument seems to be created intact and all the XML,
XMLNode, XMLDocument and DOMNode methods mostly seem to be working as they
should. The first issue I discovered was when I selected a node, duplicated
it with cloneNode, and tried to use a DOMNode method on it - which failed.

Debugging showed me that the overridden cloneNode method was not being
called - it was using the superclass' cloneNode method. Further
investigation showed that while a DOMNode created directly through an
XMLDocument instance using createElement would call the overridden methods
correctly, but nodes already on the XMLDocument accessed with any method
would use the superclass' methods instead (as if they were plain XMLNodes) -
even though they were able to successfully call DOMNode methods.

To illustrate this, I created an attachNode method on DOMNode to proxy to
the appendChild method to trace the execution path:

   public function attachNode( newChild:DOMNode ):Void {
   trace( DOMNode.attachNode );
   this.appendChild( newChild );
   }
   public function appendChild( newChild:DOMNode ):Void {
   trace( DOMNode.appendChild );
   super.appendChild( newChild );
   }

What happens is that the attachNode method is called (which proves the
object really is a DOMNode and not an XMLNode) but the overridden
appendChild method is not called - despite it being called internally! And
like I said before, an element created with XMLDocument.createElement does
call the overridden method. Bizarre.

Does anyone have any idea what is going on here? Is this something specific
to XML, any intrinsic objects, or some weird inheritance bug that can affect
any class? Is there a solution? Or am I stuck with having to rewrite the
whole set of XML methods from scratch and avoiding superclass methods
altogether?

Thanks,

Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Re: Overridden methods not called - AS2 bug?

2006-11-30 Thread Scott Whittaker

Ah, never mind - I've figured it out. The method which created a new DOMNode
from an XMLNode used a for...in loop to copy properties from the XMLNode to
the DOMNode. This was done to prevent compiler errors from assigning Flash 8
properties when compiling for Flash 7, and to keep it open for future
additions to the XMLNode class.

The problem was caused by copying function properties as well. Excluding
function types fixed the issue.

Cheers,

Scott


On 01/12/06, Scott Whittaker [EMAIL PROTECTED] wrote:


Hi guys,

I'm having a curious and somewhat annoying problem using overridden
methods in a subclass. What I am trying to do is extend the XML class into a
new XMLDocument class and the XMLNode class into a DOMNode class in order to
add some useful extra methods such as getElementByID, getElementsByTagName
and the ability to produce a customisable object map of any DOMNode. All of
this is working for the most part.

The reason I am extending the XML classes in this way is so I can get the
most out of the speed and functionality of the intrinsic methods, remain
compatible with other scripts designed to work with regular XML objects, and
take advantage of my custom methods for accessing and manipulating XML
without going for a heavyweight solution like XPath.

The constructor to create an XMLDocument composed of DOMNodes is like
this:

public function XMLDocument( source:String ) {
super();
parseXML( source );
}

public function parseXML( source:String ):Void {
super.parseXML( source );
var document:DOMNode = convertNodes( this.firstChild );
this.firstChild.removeNode();
this.appendChild( document );
}

So the XMLDocument is initialised with the default constructor and any
source string is passed along to the parseXML method to build the regular
XML structure. Next, the childNodes are converted from XMLNodes to DOMNodes
using the convertNodes recursive method. Actually the XMLNodes are not
converted as such - the information within them is used to create new
DOMNode instances and the structure recreated with the 
DOMNode.appendChildmethod (which accepts a DOMNode argument and simply passes 
it along to
super.appendChild ). Finally, the original XML tree is removed and
replaced with the new DOM tree.

The resulting XMLDocument seems to be created intact and all the XML,
XMLNode, XMLDocument and DOMNode methods mostly seem to be working as they
should. The first issue I discovered was when I selected a node, duplicated
it with cloneNode, and tried to use a DOMNode method on it - which failed.

Debugging showed me that the overridden cloneNode method was not being
called - it was using the superclass' cloneNode method. Further
investigation showed that while a DOMNode created directly through an
XMLDocument instance using createElement would call the overridden methods
correctly, but nodes already on the XMLDocument accessed with any method
would use the superclass' methods instead (as if they were plain XMLNodes) -
even though they were able to successfully call DOMNode methods.

To illustrate this, I created an attachNode method on DOMNode to proxy to
the appendChild method to trace the execution path:

public function attachNode( newChild:DOMNode ):Void {
trace( DOMNode.attachNode );
this.appendChild( newChild );
}
public function appendChild( newChild:DOMNode ):Void {
trace( DOMNode.appendChild );
super.appendChild( newChild );
}

What happens is that the attachNode method is called (which proves the
object really is a DOMNode and not an XMLNode) but the overridden
appendChild method is not called - despite it being called internally! And
like I said before, an element created with XMLDocument.createElement does
call the overridden method. Bizarre.

Does anyone have any idea what is going on here? Is this something
specific to XML, any intrinsic objects, or some weird inheritance bug that
can affect any class? Is there a solution? Or am I stuck with having to
rewrite the whole set of XML methods from scratch and avoiding superclass
methods altogether?

Thanks,

Scott


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com