SharedObject reader plugin for FD3

In the past week I was working on the SharedObject plugin for FlashDevelop 3.
First I just made a port of my previous sepy sharedobject reader python code into C#, but then for the new AMF3 sharedobject encoding I found this java class very useful.
By the way, after coding and coding.. I finally managed to create a good solution (ok, I have to test it a lot again…).
You can find the plugin here: http://code.google.com/p/fdplugins

But the interesting thing I found was another!
Flash does not read the sharedojects correctly (at least the amf0 ones)!

To reproduce this bug follow these steps:

Create a new document (flash8 / as2)
– Add this code in the timeline:
var so:SharedObject = SharedObject.getLocal("flash8", "/");
so.clear();
so.data.obj1 = new XML("");
so.data.obj2 = new Date();
so.data.obj3 = so.data.obj2;
so.data.obj4 = {a:1, b:so.data.obj1, c:[1,2,3], d:so.data.obj2};
so.data.obj5 = so.data.obj4.c;
so.flush();

you will see this in the debug view variables:
Variabile _level0.so = [oggetto #1, classe 'SharedObject'] {
data:[oggetto #2, classe 'Object'] {
obj1:[oggetto #3] {
;
},
obj2:[oggetto #4, classe 'Date'] {Sat Sep 22 19:31:31 GMT+0200 2007},
obj3:[oggetto #4, classe 'Date'],
obj4:[oggetto #5, classe 'Object'] {
d:[oggetto #4, classe 'Date'],
c:[oggetto #6, classe 'Array'] [
0:1,
1:2,
2:3
],
b:[oggetto #3],
a:1
},
obj5:[oggetto #6, classe 'Array']
}
}

ok, now remove all the code you just written and leave just this line:
var so:SharedObject = SharedObject.getLocal("flash8", "/");
and see the variables list again, you will see this:
Variabile _level0.so = [oggetto #1, classe 'SharedObject'] {
data:[oggetto #2, classe 'Object'] {
obj1:[oggetto #3] {
;
},
obj2:[oggetto #4, classe 'Date'] {Sat Sep 22 19:31:31 GMT+0200 2007},
obj3:[oggetto #5, classe 'Date'] {Sat Sep 22 19:31:31 GMT+0200 2007},
obj4:[oggetto #6, classe 'Object'] {
d:[oggetto #7, classe 'Date'] {Sat Sep 22 19:31:31 GMT+0200 2007},
c:[oggetto #8, classe 'Array'] [
0:1,
1:2,
2:3
],
b:[oggetto #6, classe 'Object'],
a:1
},
obj5:non definito
}
}

they are different! (both data.obj5 and data.obj4.b changed)

For what I understand during my experiments it seems that flash does not write into its internal references table the XML objects while reading back the file and so next time it open the sharedobject all the references after the xml are broken or just they point to a different object.

FDTracer

Click to see a preview
Andrew has just posted on his blog FDTracer, a FlashDevelop plugin which does more or less the same of my Firefox FlashTracer plugin.
Once you’ve installed the .dll plugin remember to change the plugin settings and insert the correct path of your flash player log path. ( Read more here )

Remember also that you need, like for FlashTracer Firefox addon, a debug version of flash player. It can be downloaded here


					

Flex Camp, Milan 19th October 2007

Flex Camp is a series of conferences designed to help you understand more about Adobe Flex and Adobe AIR“, first started by flex.org.

This is the first flex Camp conference in Italy, scheduled on 19th October 2007 in Milan.

– Actionscript 2 to Actionscript 3 migration
– Flex and Flash CS3 integration
– Flex Builder 3. A first look
– Flex and AIR

For more details and to participate please visit:  http://flex.actionscript.it…/title=Pagina_principale

FlashDevelop 3, unsorted plugins

Last week I started a new Flash project, and unluckily it was an ActionScript 2 project!…
Oh, It was so long time since I last wrote as2 code… I didn’t remember it’s so boring and poor . Actionscript 3 it’s a complete different world compared to as2, now I can understand this better. BTW, I decided to use for this project FlashDevelop 3. I still remember the days when they first announced the birth of this project (those days when I still was writing sepy…), but I never really try it in depth.
After 2 days using it I was fully satisfied of my choice, this is really an awesome project!

But.. because I’m too curious, I wanted to take a look also at the source code.. just to a look. Also because I never coded in C#.
Anyway, after a couple of days I found that making plugins wasn’t so hard, even if for a c# newbie like me (and also thanks to some tip from Philippe), and so I wrote down some testing plugins. they’re not killer plugins at all, just simple program addons.

1. SourceOptions: this is the very first I did and in fact it doesn’t do anything special. In AS2 and AS3 files it adds to the scintilla contextual menu three more options: “organize imports” (similar to the  one in flex), “add getter/setter method” and “add accessor method” (when you click on a class variable)

2.  Bookmarks panel: This create a docking panel displaying all the current opened files and keep updated their bookmarks.

3. Flash API panel: Similar to the one included in the Flash IDE. Just give (in the plugin settings) the path (one or more) of the xml included in the ActionsPanel flash directory and it will display the full list of all the language available actions/methods/classes. Double click on an item will insert the command in the document text giving also the description of the selected command in a tooltip.

Tip: those xml file can be found in a directory like this:

C:\Users\sephiroth\AppData\Local\Adobe\Flash CS3\en\Configuration\ActionsPanel\ActionScript_3\ActionsPanel_3.xml

4.  ASClassWizard: It overrides the “New Class” project menu command and displays a wizard dialog for creating a new ActionScript 2/3 class. Give the package, the classname, super class, implementing interfaces and it will create your class.

Note: Remember that those plugins work only with the last 1769 FlashDevelop 3 build, available here:

http://www.flashdevelop.org/community/viewtopic.php?t=1734

Project Home at http://code.google.com/p/fdplugins with all the latest versions of these plugins and more plugins

FontReader, convert TrueType fonts in graphics with Flex

In the last period I was trying to find a way to convert a TrueType font character into graphics for a new Flex project.
First I found a way using TTX which can convert a font file into an XML with all the Glyph informations needed to recreate the font outline.

But this process requires that all the .ttf files should be converted using TTX before thay can be used in Flash.
So I investigated a bit more and I found a really useful and really well done java project: TypeCast.
What I’ve done next was just to do a porting of the available java code into Actionscript 3 and it works like a charm! It can read a .ttf file and extracts all the font informations, including all the glyph outlines.

See a demonstration of thie Flex application.

Here you can download the source code:
[attachments docid=1026 force_saveas=”1″ logged_users=”0″]

senocular.com TransformTool modification

Recently I used the great senocular Transform Tool for a Flex2 project.
We just needed to made a little modification to the way the scale transformation worked. Something like the Photoshop’s Transform tool, where the registration point only affects rotation, while all the scale controls are independent from the registration point.
For this reason I modified a bit the TransformTool code to allow this feature to be set on/off (I called this scaleWithRegistration)

Hold down SHIFT key while rotating or scaling to constrain transformation
Double click to complete transformation.

[kml_flashembed publishmethod=”static” fversion=”10.0.22″ movie=”http://blog.sephiroth.it/wp-content/uploads/2007/07/test_transformation.swf” width=”400″ height=”300″ targetclass=”flashmovie” bgColor=”#cccccc”]

Get Adobe Flash player

[/kml_flashembed]

This is the code used in the mxml Application file:

< ?xml version="1.0" encoding="utf-8"?>



< ![CDATA[ import com.senocular.display.TransformTool; [Bindable] private var tool:TransformTool; private function init():void { } private function onImageComplete(event:Event):void { var timer:Timer = new Timer(1000,1); timer.addEventListener(TimerEvent.TIMER, function(evt:TimerEvent):void { createTool(null); }); timer.start(); image.addEventListener(MouseEvent.CLICK, createTool); } private function onDoubleClick(event:MouseEvent):void { removeChild(tool); tool = null; } private function createTool(event:MouseEvent):void { if(!tool) { tool = new TransformTool(); tool.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick); tool.target = image; tool.scaleWithRegistration = scale_registration.selected; addChild(tool); } } ]]>



[attachments docid=1018 force_saveas=”1″ logged_users=”0″]

New Firefox search plugins!

Thanks to Ofir Shemesh here are some new Firefox search plugins for Flex developers.

  • FlexCoders archive (search Flexcodes mailing list archived at MailArchive. also hosted at http://mycroft.mozdev.org but it is not updated. they do not archive very often so it is a “so so” source for info)
  • Flexcodes @ Nabble (search Flexcodes mailing list archived at Nabble. not hosted anywhere, it is new. they are archiving every few minutes so it is the best way to search flexcoders and their browsing format is the more convenient)
  • Flex2 – LiveDocs (as it says search at Flex 2 LiveDocs. it is also hosted at http://mycroft.mozdev.org)
  • Flexcomponents @ MailArchive – search Flexcomponents mailing list archived at MailArchive – they do not archive very often so it is a “so so” source for info.
  • Flexcomponents @ Nabble – search Flexcomponents mailing list archived at Nabble – they are archiving every few minutes so it is the best way to search flexcoders and their browsing format is MUCH more convenient

P. S. Click on the search plugin title to install for your Firefox

Papervision3D component for Flash CS3

John Grden just released an amazing component for Flash CS3 for manage papervision3d on Flash IDE.

– Design-time render and editing in Flash IDE
– 3 Material types supported – BitmapFileMaterial, BitmaAssetMaterial and MovieAssetMaterial
– Creates MovieScene3D and Free or Target camera
– Manages resizing / centering of Papervision3D scene [optional]
– Dynamic masking to constrain the viewable render area to the bounds of the component [optional]
– Full API and access to Scene, Camera, Collada objects to code around
– Automatically loads materials via Collada file [when materials list is not given]
– New Custom Panel for modifying rotation, camera zoom, camera focus, camera Z at design-time

Download component here
See the presentation video

Papervision3D at google code: http://code.google.com/p/papervision3d/