Flash Lite ExtendedKey y SharedObject en Eclipse con FDT

Por: Marcos Gonzalez Sancho (Redactor y Manager) 5 07 2009

Pues para variar cada instalación de Eclipse me tengo que comer con patatas el escaso soporte que hay para flash lite en cuanto a las clases especiales con las que cuenta, y más concretamente con ExtendedKey y SharedObject, que tiene algunas diferencias interesantes con respecto al trabajo habitual con sharedObjects en Flash convencional.

No es la primera vez que os hablamos de esto, pero algunos links ya no funcionan, asi que para no perderlo de vista, lo posteo aqui y que quede para la posteridad. Con esto ya no deberíamos tener excusas para usar Eclipse con FDT cuando hacemos proyectos en Flash Lite (doy por hecho que en proyectos de envergadura media / grande se DEBE programar con clases, y rompo nuevamente una lanza en contra de la leyenda urbana que corre por ahi de que las clases consumen más memoria… esto es un post pendiente del Sr. Elecash y mio, que seguro que algún día ve la luz).

Aquí os dejo las definiciones necesarias para ExtendedKey y para SharedObject y dónde se han añadir los correspondientes ficheros en el entorno de Eclipse + FDT, para que no nos den la lata con clases no encontradas.

ExtendedKey.as

(fichero que ha de ir ubicado en: ruta_instalacion_eclipse\configuration\com.powerflasher.fdt.core\.config\core\as2)
intrinsic class ExtendedKey
{
static var SOFT1:String = "soft1";
static var SOFT2:String = "soft2";
static var SOFT3:String = "soft3";
static var SOFT4:String = "soft4";
static var SOFT5:String = "soft5";
static var SOFT6:String = "soft6";
static var SOFT7:String = "soft7";
static var SOFT8:String = "soft8";
static var SOFT9:String = "soft9";
static var SOFT10:String = "soft10";
static var SOFT11:String = "soft11";
static var SOFT12:String = "soft12";
}

SharedObject.as

(este fichero ya existe en la ruta anteriormente mencionada para ExtendedKey, pero hay que hacerle algunas modificaciones, quedando finalmente como se muestra a continuación)
dynamic intrinsic class SharedObject
{
static function deleteAll(url : String):Void;
static function getDiskUsage(url : String):Void;
static function getLocal(name : String, localPath : String) : SharedObject;
static function getRemote(name : String, remotePath : String, persistence : Object):SharedObject;

// Flash Lite 2.x or higher
static function GetMaxSize() : Number;
static function addListener(objectName:String, notifyFunction:Function) : Void;
static function removeListener(objectName:String) : Void;
// end Flash Lite special functions

function flush(minDiskSpace : Number) : Object;
function clear() : Void;
function close() : Void;
function connect(myConnection : NetConnection) : Boolean;
function getSize() : Number;
function onStatus(infoObject : Object) : Void;
function onSync(objArray : Array) : Void;
function send(handlerName : String) : Void;
function setFps(updatesPerSecond : Number) : Boolean;
var data : Object;
}

Van en negrita las mofidicaciones, que han sido seleccionadas de la documentación oficial de Adobe Flash Lite 2.x. Ojo con el atributo dynamic, que no se ve mucho, pero es una realidad.

Ale, ahora se que tengo a mano esto cada vez que reinstale Eclipse, o alguien me lo consulte. Por otro lado, por si alguien tiene alguna versión más antigua de Eclipse, en algunas no viene fscommand2 o viene como FSCommand2. Esto lo puedes encontrar en: ruta_instalacion_eclipse\configuration\com.powerflasher.fdt.core\.config\topLevel, en el fichero TopLevel.as

Asegúrate de que en él está la línea:
function fscommand2(command:String, parameters:Object):Void;

Espero que a alguno le sea de utilidad, pero yo no soporto warnings chorras o errors falsos en la lista de problemas de Eclipse… soy un neurótico, lo reconozco… :)

Sobre el uso y buen uso de SharedObjects

Y ya que estamos que lo tiramos, unos cuantos enlaces e información interesante sobre el uso de SharedObjects en Flash Lite:

Compártenos:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Meneame
  • Netvibes
  • RSS
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

 

Si te ha gustado esta entrada quizá también te puede interesar:



Acciones

Informacion

9 respuestas a “Flash Lite ExtendedKey y SharedObject en Eclipse con FDT”

5 07 2009
Raul Jimenez (20:10:52) :

Hostias tio, esto es buenísimo, muchas gracias! ;)

5 07 2009
Marcos Gonzalez Sancho (20:26:56) :

Estaba hasta las bolas de los warnings, errores etc. cada vez que usaba las clases, asi que con un poco de documentación y de busqueda (la pena fue que en el Foro de FDT esto estaba, pero ya no se encuentra accesible…) pues lo enchufé y al postearlo aqui, ya sabemos donde encontrarlo :)

Ya podía ser todo tan fácil como esto. ;)

24 09 2009
Bruno Fonzi (06:41:03) :

Just came across this article by pure chance. I am glad to read FDT used for FlashLite projects, as a former Engineering Manager for Adobe Device Central now working for the FDT team, I am thrilled !
Let us know is we can be of any further help.

24 09 2009
Marcos Gonzalez Sancho (08:25:14) :

Hi Bruno,

Yeap, Raul and me work always with AS2 and OOP approach in Flash Lite projects, so FDT is a great enviroment to improve our action script programming. We met you at Device Central team, and it’s nice to see that you continue your work at FDT team :)

There are some topics that are not difficult to improve in FDT related to Flash Lite development. This post is an example, supporting fscommand2 in TopLevel.as and incluiding ExtendedKey and SharedObject in the as2 folder are important to avoid errors when typing actionscript for Flash Lite.

At this time, fscommand2 is supported as “FSCommand2″, but it isn’t the right format as you can see here: http://livedocs.adobe.com/flashlite/2/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000328.html
The right format is “fscommand2″, not capitalized.

ExtendedKey is not included in the as2 folder, and SharedObject is included but it doesn’t include all the available methods in Flash Lite. In this post you have the right code for these classes.

And finally to comment that in Mac I can find the TopLevel.as and the as2 folder at these paths: applications/eclipse/plugins/com.powerflasher.fdt.core_3.2.0.1029/resource (base path)/topLevel/TopLevel.as and core/as2/ but if I change this files and restart Eclipse, I don’t solve the syntax problem.

Bruno, thanks for your support and for pointing your help here :)

24 09 2009
Marcos Gonzalez Sancho (08:59:02) :

Hi Bruno, I have found the right path in Mac, at applications/eclipse/configuration/com.powerflasher.fdt.core/.config the problem was that .config is a hidden folder :)

Anyway mi previous comment is valid to include those changes to solve some flash lite problems with FDT + Eclipse :)

24 09 2009
Configurando en Mac FDT con Eclipse para Flash Lite | BlocketPc :: Flash Lite y Mobile Web (09:10:49) :

[...] esto a todos los fans de mac os la traiga al pairo, pero para mi ha sido un logro importante. A raíz de este post, os comentábamos que FDT tiene algunas “deficiencias” en las clases que incorpora como [...]

5 02 2010
Bruno Fonzi (17:50:49) :

Hi Marco, Thanks for sharing your feedback. Are you going to be at MWC this year? It would be great to catch up !

5 02 2010
Marcos Gonzalez Sancho (22:42:21) :

Hi Bruno, Yeap, I’m going to attend MWC this year! What days are you going to attend?

8 02 2010
Web Runtime and Flash Lite integrated development on Eclipse « Jappit.com (16:53:14) :

[...] FDT uses the standard ActionScript 2 classes to allow you to compile your Flash Lite project. Anyway, these lack some Flash Lite-specific classes and functions, as ExtendedKey and SharedObject.addListener() method, that have to be manually added, as also explained here. [...]

Deje un comentario

usted puede usar estos tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Get Adobe Flash playerPlugin by wpburn.com wordpress themes
computer poker online poker gambling online poker money free poker money 11.5 gram poker chips poker chips dice free on line poker online free video poker poker forums fulltiltpoker com no deposit poker bonus poker face 500 poker chips poker table felt poker flush poker ranking texas hold em poker free gambling online poker free online poker game hold em online poker poker freerolls poker sale poker online holdem real money poker online tournaments poker free three card poker holdem online poker poker gratis card games poker online hold em poker australian poker best poker online online poker bonus poker cheats clay poker chip poker casinos poker night party poker bonus code poker accessories poker free on line throatpokers folding poker table party poker code online free poker game multiplayer poker poker for fun slots poker blackjack poker royal poker bonus codes poker texas holdem poker online limit poker chips for poker poker slots winning poker online poker sites poker guide poker bet poker dealer video poker strategy free texas hold em poker poker 1000 suited poker chips deluxe poker world poker tournament poker chips suited pokerus poker shirt dice poker chips throat pokers paradisepoker poker online money pai gow -poker holdem poker online online money poker free poker texas hold roulette poker event poker world tournament poker poker websites video poker free games casino chip poker set suited poker chip set poker books poker bot rules of poker free downloads poker poker betting casino poker chip set online holdem poker texas holdem online poker poker casino game holdem poker game poker playing cards casinos poker free poker bonus free hold em poker bonus deposit no poker play poker free games world poker championship casino poker set best online poker official poker rules poker chip sets poker codes poker card game online texas holdem poker poker table top hold em poker free clay poker set 1000 poker chips party poker com home poker casino video poker chip clay poker poker freeroll poker chips custom poker reviews chip clay poker set custom poker onlinepoker rules poker texas pai gow poker club poker win poker poker deposit bonus web poker caribbean stud poker videopoker texas poker table 11.5 poker chip set top poker table www poker net online poker site poker bonus codes poker games to play poker play for free play poker games play free video poker poker texas hold em free poker 10 celebrity poker poker website poker stats clay poker chip set shirt poker poker buy fulltilt poker game of poker code party poker play free poker games poker draw bonus no deposit poker poker set clay online poker tournament dogs playing poker ultimate poker poker free downloads 500 poker chip set free poker on line pokerroom com free video poker online free texas holdem poker usa poker poker academy adult poker www partypoker play poker online free casino poker games suited poker chip poker strategies omaha poker poker 300 party poker bonus free video poker game texas holdem poker free poker felt free texas hold poker poker win strategies poker poker book free online play poker bet poker poker limit poker cheap poker de betting poker articles poker poker results mobile poker freeroll poker poker set 500 texas poker game play money poker poker club suited poker play texas poker poker videos crazy game of poker free money poker no limit poker poker supplies free poker sites free online video poker 500 chip poker set titan poker online poker tournaments poker winning poker in las vegas poker folding poker tv free games video poker learn poker poker online sites de poker poker suited no deposit bonus poker free casino poker poker custom poker play money electronic poker poker flash play poker for free absolutepoker slot poker poker school poker shirts bonus code party poker poker dvd texas poker rules pc poker poker news hold em poker online poker card games poker free money poker chip set 500 poker multiplayer poker learn online poker room card game poker pub poker www pokerstars hot poker poker tournament manager custom poker chips world championship poker online poker hold em poker free bonus poker pictures poker tournaments online play free poker online index map rss