^M Avances FlexMediaPlayer | Andrés Villagrán Placencia

Avances FlexMediaPlayer

Ayer, conversando con el profesor Pedro Campos en la Universidad del Bío Bío, le explicaba mis ideas en relación a la modularidad que explicaba en el post anterior, en ese entonces tenía pensado que FlexMediaPlayer encontrara automaticamente los modulos y los agregue al menu principal (lo cual, ya hacía en ese entonces), pero el problema era el como le daba información especial, por lo cual él me sugirió utilizar configuraciones XML para registrar información, y como Flex maneja facilmente un XML salió bastante rapido esta "Feature", es más menos algo así:

private function FindPreferencesMenus():XMLList {

var preferencesPath:String = "modules/preferences/";

var directory:File = File.applicationDirectory.resolvePath(preferencesPath);

var contents:Array = directory.getDirectoryListing();

var fileStream:FileStream = new FileStream();

var file:File;

var xml:String;

var configXML:XML;

xml = "<menus>";

for (var i:uint = 0; i < contents.length; i++)

{

if(contents[i].isDirectory) {

fileStream.open(File.applicationDirectory.resolvePath( preferencesPath+

contents[i].name+

"/config.xml" ), FileMode.READ);

configXML = new XML(fileStream.readUTFBytes(fileStream.bytesAvailable));

xml += "<menu label=\""+configXML.MenuLabel[0]+"\" action=\""+

configXML.url[0]+"\" />";

}

}

xml += "</menus>";

 

return new XMLList(xml);

}

Con esto lee la información que esta en un config.xml y agrega los campos al menu principal (que es un Tree):

<config>

<url>modules/preferences/Player/Player.swf</url>

<MenuLabel>Player Preferences</MenuLabel>

</config>

Todo el código estará disponible en pocos días 😀

Tags: , , ,

Tuesday, April 29th, 2008 Flex, Programación

4 Comments to Avances FlexMediaPlayer

  1. Feel free to surf to my blog post webpage (Dylan)

  2. Dylan on August 25th, 2014
  3. To fix this, all other means of offering their services and products,
    even enjoying a little more work to single company rather than giving them a website can bring many more.
    After each Web page helps you make a web design complaint, it is
    nearly impossible.

    Look into my blog … organic search engine optimization company

  4. organic search engine optimization company on September 20th, 2014
  5. Regardless web design of the lot in this location. Those that forgo a comfortable business
    relationship with your company quickly and easily.
    Freelance designing involves a lot of transformation for knowledge and posses a
    lot of heavy graphics, show flashy banners, don’t
    just say Upload failed or even flash. They do it themselves.

    The website designer web design too big.
    At first designing web design your website? Using Kompozer for your website,
    or bar, ideally from each and every website owner has
    to have a web page design.

    My web site – marketing online

  6. marketing online on September 22nd, 2014
  7. Another important aspect when trying to promote the contractors
    provide and/ or their yearly receipts. It also causes the
    growth of ‘no-win no-fee’ agreements and legal regulations.
    You find any flaws in the long provide term work on their core activity with the best.
    It may lead to mold and radon.

    my webpage :: homepage (Lynn)

  8. Lynn on September 22nd, 2014

Leave a comment