<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flashxpress &#187; Tutoriels Flex</title>
	<atom:link href="http://www.flashxpress.net/category/ressources-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashxpress.net</link>
	<description>Ressources pour la création et les technologies du web</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Habillez vos composants Flex avec Flash Catalyst et Illustrator</title>
		<link>http://www.flashxpress.net/ressources-flex/habillez-vos-composants-flex-avec-flash-catalyst-et-illustrator/</link>
		<comments>http://www.flashxpress.net/ressources-flex/habillez-vos-composants-flex-avec-flash-catalyst-et-illustrator/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 13:13:25 +0000</pubDate>
		<dc:creator>Erick Ghaumez</dc:creator>
				<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Illustrator]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=5461</guid>
		<description><![CDATA[Comme vous le savez sûrement, la Creative Suite 5 d&#8217;Adobe intégre Flash Catalyst, un nouvel outil dont le but est principalement de simplifier la collaboration entre designer et développeur d&#8217;applications Flex. Flash Catalyst joue, en quelque sorte, le rôle de passerelle entre les outils créatifs de la suite ( Illustrator, Photoshop, Fireworks, voire Flash ) [...]]]></description>
			<content:encoded><![CDATA[<p>Comme vous le savez sûrement, la Creative Suite 5 d&#8217;Adobe intégre Flash Catalyst, un nouvel outil dont le but est principalement de <strong>simplifier la collaboration entre designer et développeur d&#8217;applications Flex</strong>. Flash Catalyst joue, en quelque sorte, le rôle de <strong>passerelle entre les outils créatifs de la suite ( Illustrator, Photoshop, Fireworks, voire Flash ) et Flash Builder</strong>. Pour cela, la quatrième version du SDK Flex a été entièrement développée avec l&#8217;idée de pouvoir intégrer facilement les maquettes conçues par les graphistes. Quiconque a déjà tenté de personnaliser, &laquo;&nbsp;en profondeur&nbsp;&raquo;, l&#8217;apparence de composants Flex 3, sait à quel point cette simplification était nécessaire.</p>
<p>La solution pour parvenir à cette importante amélioration peut quasiment se résumer à un sigle : <strong>FXG</strong> ( Flash XML Graphics ). Le FXG est un langage de <strong>description XML d&#8217;éléments graphiques</strong>, une déclinaison du SVG à la sauce Adobe. Il est utilisé pour &laquo;&nbsp;traduire&nbsp;&raquo; en XML, les &laquo;&nbsp;compositions&nbsp;&raquo; créées dans les applications graphiques de la CS. Les interfaces d&#8217;applications Flex pouvant être décrites en MXML, un autre langage dérivé du XML, la &laquo;&nbsp;traduction&nbsp;&raquo; FXG peut y être &laquo;&nbsp;naturellement&nbsp;&raquo; intégrée, la rendant rapidement manipulable par le développeur.<br />
C&#8217;est là qu&#8217;arrive Flash Catalyst : son rôle est de <strong>transformer les fichiers Illustrator, Photoshop ou FXG ( exportés depuis Fireworks ou Flash Pro ) en projet Flex</strong>.</p>
<h3>LoginBox</h3>
<p>Dans cet exemple, nous allons voir comment intégrer dans une application Flex, une fenêtre d&#8217;identification dessinée dans Illustrator. Au niveau graphique, le choix a été volontairement porté vers une apparence &laquo;&nbsp;originale&nbsp;&raquo;, à laquelle nous n&#8217;aurions pas pu parvenir à l&#8217;aide de CSS seules.<br />
<a href="http://lafabrick.com/tutos/loginBox.zip">Télécharger les sources</a>.</p>
<p>Les trois grandes étapes de ce processus sont :<br />
1. la création de la maquette ( à l&#8217;aide d&#8217;Illustrator dans cet exemple )<br />
2. la transformation des éléments graphiques en composants Flex dans FC (Flash Catalyst)<br />
3. l&#8217;intégration des composants de l&#8217;application dans FB (Flash Builder)</p>
<h3>Préparation de la maquette dans Illustrator</h3>
<p>Le fichier <em>loginBox.ai</em> contient l&#8217;habillage proposé pour un composant d&#8217;identification. Les différents &laquo;&nbsp;états&nbsp;&raquo; et comportements du composant y sont représentés et décrits.</p>
<p><img class="aligncenter size-full wp-image-5486" title="le composant d'identification" src="http://www.flashxpress.net/wp-content/uploads/2010/12/01_i.png" alt="" width="480" height="158" /></p>
<p>C&#8217;est ce fichier que nous allons importer dans Flash Catalyst et <strong>transformer en composant Flex</strong>.<br />
En terme de préparation du document Illustrator, il n&#8217;y a pas vraiment d&#8217;obligation, mais comme d&#8217;habitude, un peu d&#8217;organisation peut  faire gagner du temps par la suite.<br />
Il peut être, par exemple, pratique de répartir les différents éléments sur plusieurs calques. Ici, deux calques ont été créés : &laquo;&nbsp;composant&nbsp;&raquo; et &laquo;&nbsp;notes&nbsp;&raquo;. On peut également grouper/dégrouper et nommer &laquo;&nbsp;distinctement&nbsp;&raquo;  les  différentes &laquo;&nbsp;entités cohérentes&nbsp;&raquo; du composant ( icônes, champs de saisie,  bouton, &#8230;).</p>
<p><img class="aligncenter size-full wp-image-5483" title="organisation Illustrator" src="http://www.flashxpress.net/wp-content/uploads/2010/12/02_i.jpg" alt="" width="337" height="280" /></p>
<h3>Flash Catalyst</h3>
<p>Lançons maintenant FC, et créons un<strong> nouveau projet à partir de notre fichier Illustrator</strong>.</p>
<p><img class="aligncenter size-full wp-image-5488" title="ouverture de fichier Illustrator dans Flash Catalyst" src="http://www.flashxpress.net/wp-content/uploads/2010/12/01_c.png" alt="" width="630" height="217" /></p>
<p>Différentes options d&#8217;importation nous sont proposées : maintien des polices, des dégradés&#8230; Dans cet exemple, nous nous contenterons des conversions automatiques.</p>
<p><img class="aligncenter size-full wp-image-5489" title="options d'importation Flash Catalyst" src="http://www.flashxpress.net/wp-content/uploads/2010/12/02_Catalyst.jpg" alt="" width="511" height="355" /></p>
<p>Quelques secondes de conversion plus tard, la maquette dessinée dans Illustrator, apparait &laquo;&nbsp;à l&#8217;identique“ dans l&#8217;interface de FC.</p>
<p><img class="aligncenter size-full wp-image-5490" title="03_c" src="http://www.flashxpress.net/wp-content/uploads/2010/12/03_c.png" alt="" width="630" height="420" /></p>
<p>A ce stade, le projet généré par FC est déjà un projet &laquo;&nbsp;Flex&nbsp;&raquo;. En l&#8217;enregistrant, nous nous apercevons que le fichier est sauvegardé au format FXP ( Flex Project ). Si l&#8217;on publie le projet ( Menu Fichier » Run Project ), il est compilé et ouvert dans un navigateur. Ce fichier pouvant être importé dans Flash Builder, le travail de FC pourrait s&#8217;achever ici&#8230; Mais nous allons aller un peu plus loin dans la préparation de ce composant d&#8217;identification. FC va en effet nous permettre de transformer les éléments de cette maquette graphique en composants interactifs.</p>
<p>Les différents sous-composants de notre loginBox sont :<br />
- les deux champs de saisie<br />
- les deux icônes<br />
- la CheckBox de mémorisation<br />
- le bouton de validation<br />
- la zone d&#8217;affichage d&#8217;erreur</p>
<h4>Les champs textes</h4>
<p>Commençons par les champs de saisie. Nous allons sélectionner les deux élements graphiques représentant un des champs : la bordure et le champ texte. Le petit panel de Conversion ( Menu Window/HUD ) va nous permettre de transformer ces deux éléments graphiques en un composant TextInput Flex.</p>
<p><img class="aligncenter size-full wp-image-5491" title="transformation d'élement graphique en textInput" src="http://www.flashxpress.net/wp-content/uploads/2010/12/04_c.png" alt="" width="664" height="215" /></p>
<p>L&#8217;architecture <strong>Spark</strong>, introduite dans Flex 4, est basée sur la séparation entre la couche logique des composants, définie dans une classe AS3, et leur couche graphique ou &laquo;&nbsp;Skin&nbsp;&raquo;, définie elle, dans un fichier MXML. Cette séparation s&#8217;appuie sur <strong>un &laquo;&nbsp;contrat&nbsp;&raquo; entre l&#8217;actionScript et la skin</strong>. Le contrat stipule entre autre, le(s) sous- élément(s) qui doivent être définis dans la skin : ces éléments sont appelés &laquo;&nbsp;<strong>SkinParts</strong>&laquo;&nbsp;. Dans le fichier AS du composant, ils sont déclarés à l&#8217;aide de la metadata [SkinPart]</p>
<p>Un TextInput est généralement constitué d&#8217;une bordure et d&#8217;un champ de texte éditable. Pour ce composant, une seule skinPart est définie, il s&#8217;agit du champ de texte, le Text Display ( propriété nommée labelDisplay dans le fichier AS de définition du composant spark.TextInput ). En sélectionnant notre composant, on peut voir que le panel HUD nous propose d&#8217;éditer les &laquo;&nbsp;parts&nbsp;&raquo;. Une fois ce bouton cliqué, nous avons accès à l&#8217;édition &laquo;&nbsp;interne&nbsp;&raquo; du composant TextInput.</p>
<p><img class="aligncenter size-full wp-image-5493" title="édition de skinParts" src="http://www.flashxpress.net/wp-content/uploads/2010/12/05_c.png" alt="" width="632" height="165" /></p>
<p>Il nous faut à présent vérifier lequel des éléments graphiques inclus dans le composant, est considéré comme la représentation du champ de texte. Pour cela, nous sélectionnons le champ de texte, et nous nous assurerons qu&#8217;il s&#8217;agit bien de la <strong>skinPart &laquo;&nbsp;Text Display&nbsp;&raquo;</strong>.</p>
<p><img class="aligncenter size-full wp-image-5494" title="définition de la skinPart Text Display" src="http://www.flashxpress.net/wp-content/uploads/2010/12/06_c.png" alt="" width="631" height="156" /></p>
<p>Une fois à l&#8217;intérieur de cette skin de composant, on peut également <strong>définir l&#8217;apparence en fonction de l&#8217;état</strong>. Un TextInput défini deux états : &laquo;&nbsp;normal&nbsp;&raquo; et &laquo;&nbsp;disabled&nbsp;&raquo;. Ces états sont appelés &laquo;&nbsp;SkinStates&nbsp;&raquo;, et font également partie du contrat entre le composant et sa skin : <strong>la skin d&#8217;un composant doit définir l&#8217;ensemble des skinStates déclarés dans son composant de référence</strong>.</p>
<p><img class="aligncenter size-full wp-image-5495" title="vignettes d'états" src="http://www.flashxpress.net/wp-content/uploads/2010/12/07_c.png" alt="" width="440" height="253" /></p>
<p>Nous pouvons ici définir que dans l&#8217;état “disabled&nbsp;&raquo;, notre composant aura une opacité de 30%. Pour cela :<br />
- sélectionnez la vignette &#8216;Disabled&#8217;,<br />
- sélectionnez la bordure et le champ texte,<br />
- modifiez l&#8217;opacité dans le panel &laquo;&nbsp;Propriétés&nbsp;&raquo;</p>
<p><img class="aligncenter size-full wp-image-5496" title="définition de l'apparence de l'état 'disabled'" src="http://www.flashxpress.net/wp-content/uploads/2010/12/08_c-1.png" alt="" width="630" height="306" /></p>
<p>Nous pouvons maintenant re-publier le projet. Notre maquette contient à présent un champ de texte éditable.</p>
<p>Nous pouvons maintenant revenir sur la scène principal à l&#8217;aide du fil d&#8217;ariane affiché sous les vignettes d&#8217;états.<br />
Les deux champs textes n&#8217;ayant pas exactement la même apparence, nous allons refaire une deuxième fois, les mêmes opérations, cette fois pour le champ  &laquo;&nbsp;Mot de passe&nbsp;&raquo;.<br />
Ce dernier devra en plus, masquer ses caractères, et pour cela nous pouvons cocher la propriété &laquo;&nbsp;Display as Password&nbsp;&raquo; du panel.</p>
<p><img class="aligncenter size-full wp-image-5505" title="masquage des caractères du champ &quot;mot de passe&quot;" src="http://www.flashxpress.net/wp-content/uploads/2010/12/c_displayAsPassword.png" alt="" width="332" height="175" /></p>
<p>Pour rester organisé, renommons dès maintenant les deux TextInputs dans le panel de calques.</p>
<p><img class="aligncenter size-full wp-image-5497" title="calques de champs de texte" src="http://www.flashxpress.net/wp-content/uploads/2010/12/09_c.jpg" alt="" width="273" height="111" /></p>
<p>FC permet de définir quelques interactions ( lancement de transitions, de vidéos, ouverture d&#8217;url&#8230;), mais pas suffisamment pour gérer un système de &laquo;&nbsp;prompt&nbsp;&raquo; ( texte affiché par défaut ) dans un TextInput. De même pour le changement de caractère de masquage dans le champ Password. Ces fonctionnalités pourront par contre être ajoutées côté développeur, dans Flash Builder. </p>
<h4>Passons au composant CheckBox</h4>
<p>Pour Flex, une CheckBox est constituée d&#8217;un bouton et d&#8217;un label.<br />
Nous allons donc sélectionner les éléments représentant la case, la coche et le label &#8216;Mémoriser&nbsp;&raquo;, et comme pour le TextInput, convertir ces éléments en composant, cette fois de type CheckBox. Nous pouvons utiliser le panel HUD, ou un clic-droit sur la sélection » Convert Artwork to Component » CheckBox.</p>
<p><img class="aligncenter size-full wp-image-5498" title="création du composant Checkbox" src="http://www.flashxpress.net/wp-content/uploads/2010/12/10_c.png" alt="" width="630" height="153" /></p>
<p>Une checkbox peut être affichée dans différents états, et doit définir une skinPart appelée &laquo;&nbsp;label&nbsp;&raquo;.<br />
Pour définir le label :<br />
- Double-cliquez sur le composant pour l&#8217;éditer,<br />
- sélectionnez le champ de texte,<br />
- convertissez-le en skinPart &laquo;&nbsp;label&nbsp;&raquo; à l&#8217;aide du panel HUD.</p>
<p>Nous pouvons ensuite modifier l&#8217;apparence du bouton en fonction de son état. Pour les CheckBox, 7 états sont définis : up ( dé-sélectionné normal ), over ( dé-sélectionné rollover ), down ( dé-sélectionné cliqué ), selectup up ( sélectionné normal ), selected over ( sélectionné rollover ), down (  cliqué ) et disabled.<br />
Vous pouvez sélectionnez chaque vignette d&#8217;état et apporter les changements d&#8217;apparence nécessaires dans le panel Propriétés ( par exemple, supprimer la coche dans les états &laquo;&nbsp;dé-sélectionné&nbsp;&raquo;, afficher la coche et le label en gris dans les états &laquo;&nbsp;rollOver&nbsp;&raquo;, une opacité de 30% pour l&#8217;état &laquo;&nbsp;disabled&nbsp;&raquo;&#8230; )</p>
<p><img class="aligncenter size-full wp-image-5501" title="les états de la CheckBox" src="http://www.flashxpress.net/wp-content/uploads/2010/12/12b_c.png" alt="" width="628" height="273" /></p>
<p>Une fois les différents états définis vous pouvez tester dans le navigateur. La case à cocher est active.</p>
<h4>Le composant Button</h4>
<p>Pour créer le bouton de validation :<br />
- sélectionnez la bordure du bouton et le champ texte de label,<br />
- convertissez en Composant &laquo;&nbsp;Button&nbsp;&raquo;,<br />
- double-cliquez sur le composant créé,<br />
- sélectionnez le champ de texte et dans le panel HUD, choisissez la part &laquo;&nbsp;Label&nbsp;&raquo;<br />
- éditez l&#8217;apparence pour les 4 états</p>
<h4>Icônes</h4>
<p>Dernière étape, nous allons convertir les icones vectorielles en bitmap.<br />
- sélectionnez chaque icône<br />
- clic-droit » rasterize</p>
<p><img class="aligncenter size-full wp-image-5499" title="Rasterisation d'icône" src="http://www.flashxpress.net/wp-content/uploads/2010/12/12_c.png" alt="" width="425" height="346" /></p>
<p>Pour finir, nous allons créér notre composant d&#8217;identification global, constitué des différents sous-composants créés et des formes d&#8217;arrière-plan.</p>
<p>Pour cela :<br />
- sélectionnez les différentes parties,<br />
- convertissez les en &laquo;&nbsp;<strong>Custom/Generic component</strong>&laquo;&nbsp;.</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/12/c_customCompo.png"><img class="aligncenter size-full wp-image-5507" title="Création de composant personnalisé" src="http://www.flashxpress.net/wp-content/uploads/2010/12/c_customCompo.png" alt="" width="629" height="278" /></a></p>
<p>Un peu de ménage sur la scène, de renommage dans le panel Librairie, et notre composant est prêt à être exporté vers Flash Builder.</p>
<p>Plusieurs techniques sont possibles pour utiliser ce composant dans une application Flex. La plus simple pour préserver un maximum de souplesse pour le designer et le développeur, sera d&#8217;<strong>exporter le projet sous la forme d&#8217;un projet de Librairie Flex</strong>. Cela permettra, entre autre d&#8217;utiliser les composants créés dans plusieurs projets. Pour cela:<br />
- affichez le <strong>panel Librairie</strong>,<br />
- cliquez sur le bouton &laquo;&nbsp;<strong>Exporter la librairie</strong>&nbsp;&raquo;</p>
<p><img class="aligncenter size-full wp-image-5503" title="Export de la librairie Flex" src="http://www.flashxpress.net/wp-content/uploads/2010/12/14_c.png" alt="" width="343" height="443" /></p>
<p>Le fichier est exporté au<strong> format FXPL ( Flex Project Library)</strong>. Nous verrons prochainement comment utiliser cette librairie dans une application Flex&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flex/habillez-vos-composants-flex-avec-flash-catalyst-et-illustrator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Créer une appli Android avec Flash Builder 4</title>
		<link>http://www.flashxpress.net/ressources-flash/creer-une-appli-android-avec-flash-builder-4/</link>
		<comments>http://www.flashxpress.net/ressources-flash/creer-une-appli-android-avec-flash-builder-4/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 15:22:40 +0000</pubDate>
		<dc:creator>Nicolas Gans</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Builder]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=5361</guid>
		<description><![CDATA[Avec la sortie de AIR 2.5, il est maintenant possible de développer avec Flash ou Flash Builder 4 des appli AIR s&#8217;exécutant sous Android 2.2 (Froyo). Très bonne nouvelle donc, mais passer de l&#8217;intention à la pratique n&#8217;est pas de tout repos. Avec un peu de patience et ce tutoriel, vous devriez y parvenir ! [...]]]></description>
			<content:encoded><![CDATA[<p id="internal-source-marker_0.7492338532393342"><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/illust_tuto_AIR_2.5.jpg"><img class="alignnone size-full wp-image-5414" title="illust_tuto_AIR_2.5" src="http://www.flashxpress.net/wp-content/uploads/2010/11/illust_tuto_AIR_2.5.jpg" alt="" width="630" height="200" /></a></p>
<p>Avec la sortie de AIR 2.5, il est maintenant possible de développer avec Flash ou Flash Builder 4 des appli AIR s&#8217;exécutant sous Android 2.2 (Froyo).</p>
<p>Très bonne nouvelle donc, mais passer de l&#8217;intention à la pratique n&#8217;est pas de tout repos. Avec un peu de patience et ce tutoriel, vous devriez y parvenir !</p>
<p>Nous allons donc voir ensemble comment créer une appli AIR pour Android à l&#8217;aide Flash Builder 4.</p>
<h2>Installation de AIR 2.5 pour Flash Builder 4</h2>
<p>Tout d’abord il faut télécharger le SDK de AIR 2.5 à cette URL<br />
<a href="http://www.adobe.com/products/air/sdk/">http://www.adobe.com/products/air/sdk/</a></p>
<p>Si Flash Builder 4 est ouvert, le fermer.</p>
<p>Puis aller dans le répertoire de FB4 qui contient les SDK.<br />
Sur windows, il se trouve par défaut ici : <strong>C:\Program Files\Adobe\Adobe Flash Builder 4\sdks</strong></p>
<p>Dans ce répertoire se trouvent les différents SDKs installés :<br />
Vérifier que le 4.1.0 est bien installé (si ce SDK n&#8217;est pas installé, il faut le télécharger à cette URL <a title="Flex SDK 4.1" href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>, et suivre la même procédure) :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_1.png"><img class="alignnone size-full wp-image-5382" title="012_install_AIR2.5_1" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_1.png" alt="" width="578" height="121" /></a></p>
<p>Créer une copie du répertoire 4.1.0 :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_2.png"><img class="alignnone size-full wp-image-5383" title="012_install_AIR2.5_2" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_2.png" alt="" width="512" height="118" /></a></p>
<p>Renommer la copie en &#8216;AIR2.5&#8242; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_3.png"><img class="alignnone size-full wp-image-5384" title="012_install_AIR2.5_3" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_3.png" alt="" width="513" height="110" /></a></p>
<p>Coller  le .zip du SDK téléchargé précédemment dans ce répertoire, et extraire  le .zip dans le répertoire en <strong>veillant bien à ce que les fichiers  extraits écrasent les fichiers existant portant le même nom (c’est  important)</strong> :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_4.png"><img class="alignnone size-full wp-image-5385" title="012_install_AIR2.5_4" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_4.png" alt="" width="245" height="363" /></a></p>
<p>Lancer FB et aller dans les préférences. Window &gt; preferences (Fenêtre &gt; préférences)<br />
Dans le moteur de recherche, taper “sdk”, puis sélectionner “Installed Flex SDKs”.<br />
Vous pouvez voir la liste des SDKs installés, les mêmes que dans le répertoire &#8216;sdks&#8217; vu précédemment. Cliquer sur le bouton &#8216;Add&#8230;&#8217; situé à droite de la liste :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_5.png"><img class="alignnone size-full wp-image-5386" title="012_install_AIR2.5_5" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_5.png" alt="" width="629" height="443" /></a></p>
<p>Dans la fenêtre ouverte,<br />
&#8216;Flex SDK location&#8217; : parcourir le disque dur et sélectionner le répertoire &#8216;AIR2.5&#8242; crée précédemment.<br />
&#8216;Flex SDK name&#8217; : taper &#8216;AIR2.5&#8242;<br />
Puis valider en cliquant sur &#8216;OK&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_6.png"><img class="alignnone size-full wp-image-5387" title="012_install_AIR2.5_6" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_6.png" alt="" width="514" height="195" /></a></p>
<p>En principe, le SDK doit dorénavant apparaître dans la liste des SDKs installés :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_7.png"><img class="alignnone size-full wp-image-5388" title="012_install_AIR2.5_7" src="http://www.flashxpress.net/wp-content/uploads/2010/11/012_install_AIR2.5_7.png" alt="" width="642" height="443" /></a></p>
<p>Nous pouvons maintenant créer notre premier projet Android dans Flash Builder 4.</p>
<h2>Créer un projet AIR 2.5 dans Flash Builder 4</h2>
<p><strong>Pour faire du AIR2.5 en ActionScript 3 pur (sans le framework Flex), il faut créer un projet &laquo;&nbsp;Flex Project&nbsp;&raquo;.</strong><br />
Il est en effet impossible de créer un projet AIR dans FB4 avec les projets &#8216;ActionScript&#8217; ou &#8216;Flash Professional&#8217;.</p>
<p><strong>Pour faire un projet Flex pour Android, il faudra attendre la sortie de Flex &laquo;&nbsp;Hero&nbsp;&raquo;.</strong></p>
<p>Aller dans le menu &#8216;File &gt; new &gt; Flex Project&#8217;.<br />
Donner un nom à votre projet, ici &#8216;PremiereAppli&#8217;<br />
Laisser l&#8217;emplacement par défaut ou choisir un autre emplacement.<br />
Sélectionner &#8216;Desktop&#8217;.<br />
Sélectionner le SDK &#8216;AIR2.5&#8242; crée précédemment.<br />
Puis cliquer sur &#8216;Next&#8217;, puis à nouveau sur &#8216;Next&#8217; pour arriver à la troisième étape.</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/001_projet_AIR.png"><img class="alignnone size-full wp-image-5365" title="001_projet_AIR" src="http://www.flashxpress.net/wp-content/uploads/2010/11/001_projet_AIR.png" alt="" width="602" height="634" /></a></p>
<p>Dans le champ &#8216;Main application file&#8217; (la classe du document de votre projet), <strong>changer l&#8217;extension &#8216;.mxml&#8217; en &#8216;.as&#8217;.</strong><br />
Donner une ID unique à votre projet en ajoutant un namespace (com.votresite.VotreAppli) dans le champ du dessous.<br />
Puis cliquer sur &#8216;Finish&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/002_projet_AIR.png"><img class="alignnone size-full wp-image-5366" title="002_projet_AIR" src="http://www.flashxpress.net/wp-content/uploads/2010/11/002_projet_AIR.png" alt="" width="602" height="712" /></a></p>
<p id="internal-source-marker_0.7492338532393342">En principe, votre projet doit apparaître dans le &#8216;Package Explorer&#8217;.<br />
Dans le dossier &#8216;src&#8217; (les sources), vous devriez voir votre classe du document (<strong>PremiereAppli.as</strong>) ainsi qu&#8217;un fichier &#8216;<strong>PremierAppli-app.xml</strong>&#8216; : il s&#8217;agit du fichier <strong>Descriptor</strong>, qui va vous permettre de configurer l&#8217;apparence et le comportement de base de votre appli Android.</p>
<p><a href="../wp-content/uploads/2010/11/003_projet_AIR_package_explorer.png"><img title="003_projet_AIR_package_explorer" src="../wp-content/uploads/2010/11/003_projet_AIR_package_explorer.png" alt="" width="399" height="171" /></a></p>
<h2>Le fichier descriptor</h2>
<p>Le fichier &#8216;<strong>PremierAppli-app.xml</strong>&#8216; est un fichier &#8216;descriptor&#8217;. Ce fichier est généré automatiquement lors de la création d’un projet AIR dans FB. Il s&#8217;agit d&#8217;un template, qu&#8217;il va falloir modifier.<br />
Vous y trouverez une flopée de nœuds XML qui permettent de configurer  notre appli. La plupart sont commentés (&lt;!&#8211; &lt;noeud&gt; &#8211;&gt;) :<strong> il faudra décommenter les noeuds que vous souhaitez renseigner. </strong></p>
<p>Pour cibler AIR Android, <strong>il faudra obligatoirement renseigner certains noeuds</strong>.</p>
<p>Pour la liste complète des noeuds et leur description, c&#8217;est ici : <a href="http://j.mp/dB688N">http://j.mp/dB688N</a></p>
<p>Ouvrer le fichier descriptor du répertoire &#8216;src&#8217; dans FB ou avec un éditeur XML.</p>
<p><span style="text-decoration: underline;"><strong>A renseigner obligatoirement :</strong></span></p>
<p>- Le <strong>namespace </strong>: version de AIR ciblée. Si vous ne voyez pas ceci au début du fichier, il y a un soucis :</p>
<pre>&lt;application xmlns="http://ns.adobe.com/air/application/2.5"&gt;</pre>
<p>- Les &#8216;<strong>profiles</strong>&#8216; : un &#8216;profile&#8217; permet de cibler tel ou tel device (appli de bureau, appli mobile&#8230;) en activant ou désactivant certaines fonctionnalités de AIR en fonction de cette cible.  Pour la liste complète des &#8216;profiles&#8217; AIR 2.5 et leur description, voir ici : <a href="http://bit.ly/aOlHQ3">http://bit.ly/aOlHQ3</a>.<br />
<strong>Si vous utilisez l’accéleromètre ou la géolocalisation dans votre appli</strong>, il faudra renseigner le noeud &lt;supportedProfile&gt; (penser à décommenter !) :</p>
<pre>&lt;supportedProfiles&gt;mobileDevice&lt;/supportedProfiles&gt;</pre>
<p>- Décommenter le noeud <strong>&lt;visible&gt;</strong> et le passer à true :</p>
<pre>&lt;visible&gt;true&lt;/visible&gt;</pre>
<p><span style="text-decoration: underline;"><strong><br />
Optionnel : </strong></span><br />
les icones de l’appli (pour android, ne mettre que les suivantes)</p>
<pre>&lt;icon&gt;
&lt;image16x16&gt;icone_16x16.png&lt;/image16x16&gt;
&lt;image32x32&gt;icone_32x32.png&lt;/image32x32&gt;
&lt;image48x48&gt;icone_48x48.png&lt;/image48x48&gt;
&lt;image128x128&gt;icone_128x128.png&lt;/image128x128&gt;
&lt;/icon&gt;</pre>
<p>Pour Android, décommenter le noeud &lt;android&gt; qui va permettre de générer un manifest.xml dans l&#8217;appli :<br />
&lt;android&gt;<br />
&#8230;<br />
&lt;/android&gt;</p>
<h2>Le certificat</h2>
<p>Pour générer votre appli, il va vous falloir la signer avec un <strong>certificat</strong>, fichier au format .p12.</p>
<p>Si vous possédez déjà un tel fichier, vous pouvez l&#8217;utiliser, sinon il va falloir générer ce certificat. Flash Builder permet de le faire.</p>
<p>Cliquer sur l&#8217;icone &#8216;export release build&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/000_export_release.png"><img class="alignnone size-full wp-image-5410" title="000_export_release" src="http://www.flashxpress.net/wp-content/uploads/2010/11/000_export_release.png" alt="" width="304" height="82" /></a></p>
<p>Laisser tel quel et cliquez sur &#8216;next&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/004_projet_AIR_release.png"><img class="alignnone size-full wp-image-5368" title="004_projet_AIR_release" src="http://www.flashxpress.net/wp-content/uploads/2010/11/004_projet_AIR_release.png" alt="" width="657" height="550" /></a></p>
<p>Cliquer sur &#8216;Create&#8230;&#8217; pour créer un certificat :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/005_projet_AIR_certificat.png"><img class="alignnone size-full wp-image-5369" title="005_projet_AIR_certificat" src="http://www.flashxpress.net/wp-content/uploads/2010/11/005_projet_AIR_certificat.png" alt="" width="657" height="550" /></a></p>
<p>Renseigner le certificat en indiquant votre nom, celui de votre organisation, le pays et taper un mot de passe.<br />
Puis choisir l&#8217;emplacement de sauvegarde de votre certificat (&#8216;Save as&#8217;). Pour ma part, j&#8217;ai créé un dossier &#8216;release&#8217; dans mon projet Flex.</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/006_projet_AIR_certificat_2.png"><img class="alignnone size-full wp-image-5370" title="006_projet_AIR_certificat_2" src="http://www.flashxpress.net/wp-content/uploads/2010/11/006_projet_AIR_certificat_2.png" alt="" width="488" height="434" /></a></p>
<p>Pour générer le certificat, cliquez sur &#8216;Finish&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/007_projet_AIR_certificat_3.png"><img class="alignnone size-full wp-image-5371" title="007_projet_AIR_certificat_3" src="http://www.flashxpress.net/wp-content/uploads/2010/11/007_projet_AIR_certificat_3.png" alt="" width="657" height="550" /></a></p>
<p><strong>Courage, nous y sommes bientôt !</strong></p>
<h2>Fichiers de release</h2>
<p>Dernière étape avant la génération de notre appli Android, vérifiez que vous avez en votre possession tous les fichiers requis. Pour ma part, j&#8217;ai crée un dossier &#8216;release&#8217; dans lequel j&#8217;ai placé tous ces fichiers :</p>
<p>Au minimum, il vous faut :</p>
<ul id="internal-source-marker_0.7492338532393342">
<li>MonAppli.swf &gt; l’appli</li>
<li>MonAppli-app.xml &gt; le fichier descriptor de l’appli .air</li>
<li>monCertif.p12 &gt; certificat</li>
</ul>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/008_projet_AIR_release.png"><img class="alignnone size-full wp-image-5372" title="008_projet_AIR_release" src="http://www.flashxpress.net/wp-content/uploads/2010/11/008_projet_AIR_release.png" alt="" width="391" height="282" /></a></p>
<p>Voilà vous êtes prêts !</p>
<h2>Création du fichier .apk</h2>
<p>Dernière étape, il va nous falloir packager notre appli AIR dans un <strong>fichier .apk</strong> (le format des appli Android), qui n&#8217;est autre qu&#8217;un fichier .zip contenant pleins de fichiers ainsi que les fichiers de votre appli.</p>
<p>Pour packager, plusieurs options se présentent :</p>
<ul>
<li>Option <strong>NERD </strong>: ligne de commande&#8230;<br />
Voir <a href="http://polygeek.com/2958_flex_creating-your-first-air-app-for-android-using-flash-builder">http://polygeek.com/2958_flex_creating-your-first-air-app-for-android-using-flash-builder</a></li>
</ul>
<ul>
<li>Option <strong>GEEK </strong>: tache Ant<br />
Voir <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/">http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/</a></li>
</ul>
<ul>
<li>Option <strong>NOOB </strong>: package assistant pro de Serge Jespers<br />
<a href="http://www.webkitchen.be/package-assistant-pro/">http://www.webkitchen.be/package-assistant-pro/</a></li>
</ul>
<p>Etant allergique à la ligne de commande et pas assez flexeux pour utiliser Ant, j&#8217;ai choisi l&#8217;option Noob, une petite appli AIR crée par Serge Jespers, qui vous package automatiquement votre .apk.</p>
<p><span style="text-decoration: underline;"><strong>Serge, I Love You !</strong></span></p>
<p>Après installation de package assistant pro, lancer l&#8217;appli.</p>
<p>Première étape, les préférences :</p>
<p><strong>Where is JAVA.exe ?</strong><br />
Trouver le l&#8217;emplacement du fichier java.exe sur votre HDD.<br />
Sur windows, il devrait se trouver ici : <strong>C:\Program Files\Java\jre6\bin\java.exe</strong></p>
<p><strong>Where is ADT.jar for AIR 2.5 ?</strong><br />
En principe, vous le trouvez ici :<strong> C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\AIR2.5\lib\adt.jar</strong></p>
<p><strong>Where is your certificate ? </strong><br />
Indiquez l&#8217;emplacement du certificat .p12 généré précédemment (chez moi, il se trouve dans le dossier &#8216;release&#8217; de mon projet FB4).</p>
<p>Cliquez ensuite sur &#8216;Save&#8217; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/009_packager_1.png"><img class="alignnone size-full wp-image-5373" title="009_packager_1" src="http://www.flashxpress.net/wp-content/uploads/2010/11/009_packager_1.png" alt="" width="420" height="480" /></a></p>
<p>Choisir Package APK :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_2.png"><img class="alignnone size-full wp-image-5374" title="010_packager_2" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_2.png" alt="" width="420" height="480" /></a></p>
<p><strong>1ere étape :</strong><br />
Indiquer l&#8217;emplacement de votre fichier descriptor (&#8216;PremierAppli-app.xml&#8217;) :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_3.png"><img class="alignnone size-full wp-image-5375" title="010_packager_3" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_3.png" alt="" width="420" height="480" /></a></p>
<p><strong>2e étape :</strong><br />
Vérifier que le fichier SWF indiqué dans le champ est bien le bon. Sinon, sélectionnez le bon fichier :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_4.png"><img class="alignnone size-full wp-image-5376" title="010_packager_4" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_4.png" alt="" width="420" height="480" /></a></p>
<p><strong>3e étape :</strong><br />
Ajouter les éventuels fichiers additionnels de votre appli (assets, fichiers de config&#8230;) :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_5.png"><img class="alignnone size-full wp-image-5377" title="010_packager_5" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_5.png" alt="" width="420" height="480" /></a></p>
<p><strong>4e étape :</strong><br />
Indiquer le mot de passe de votre certificat :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_6.png"><img class="alignnone size-full wp-image-5378" title="010_packager_6" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_6.png" alt="" width="420" height="480" /></a></p>
<p><strong>5e étape :</strong><br />
Indiquer l&#8217;emplacement de sauvegarde et le nom de votre fichier .apk.<br />
Puis cliquer sur &#8216;<strong>COMPILE</strong>&#8216; :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_7.png"><img class="alignnone size-full wp-image-5379" title="010_packager_7" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_7.png" alt="" width="420" height="480" /></a></p>
<p>Roulements de tambour&#8230;&#8230;&#8230;<br />
ça passe !</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_8.png"><img class="alignnone size-full wp-image-5380" title="010_packager_8" src="http://www.flashxpress.net/wp-content/uploads/2010/11/010_packager_8.png" alt="" width="420" height="480" /></a></p>
<p>Vous retrouverez votre fichier .apk à l&#8217;emplacement indiqué :</p>
<p><a href="http://www.flashxpress.net/wp-content/uploads/2010/11/011_creation_apk.png"><img class="alignnone size-full wp-image-5381" title="011_creation_apk" src="http://www.flashxpress.net/wp-content/uploads/2010/11/011_creation_apk.png" alt="" width="394" height="208" /></a></p>
<p>OUF ! On a échappé à la ligne de commande ! Encore merci M. Jespers !</p>
<h2>Conclusion</h2>
<p>Comme vous le voyez, le process de création d&#8217;un .apk n&#8217;est pas d&#8217;une grande simplicité pour le moment&#8230; Souhaitons qu&#8217;Adobe fournisse très vite des outils intégrés à Flash Builder qui simplifient un peu tout ça.</p>
<p><strong>Prochaine étape de ce tutoriel très bientôt : tester votre appli .apk sur votre device Android. </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/creer-une-appli-android-avec-flash-builder-4/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Les nouveautés de Flex 4 [part 2]</title>
		<link>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-2/</link>
		<comments>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-2/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 11:34:42 +0000</pubDate>
		<dc:creator>David Deraedt</dc:creator>
				<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=4355</guid>
		<description><![CDATA[Cette présentation vidéo en deux parties de David Deraedt s’adresse aux développeurs Flex qui désirent d’avoir un aperçu des nouveautés apportées par la version 4 de Flex, actuellement disponible en version Beta.

La première partie s’intéresse à l’environnement de développement Flash builder 4 beta, et expose un certain nombre de nouvelles fonctionnalités telles que le package explorer, ou encore la génération de getter/setters.

La deuxième partie présente le framework Flex 4 Beta, en particulier la nouvelle architecture de composants et le skinning.]]></description>
			<content:encoded><![CDATA[<p><div id="tuto_Flex4_part2">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/tuto_Flex4_part2.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("tuto_Flex4_part2").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/tuto_Flex4_part2.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/tuto_Flex4_part2.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Cette présentation vidéo en deux parties de <a title="David Deraedt" href="http://www.dehats.com/drupal/" target="_blank">David Deraedt</a> s’adresse aux développeurs Flex qui désirent d’avoir un aperçu des nouveautés apportées par la version 4 de Flex, actuellement disponible en version Beta.</p>
<p>La <a href="http://www.flashxpress.net/ressources-flex/les-nouveautes-de-flex-4-part-1/">première partie</a> s’intéresse à l’environnement de développement Flash builder 4 beta, et expose un certain nombre de nouvelles fonctionnalités telles que le package explorer, ou encore la génération de getter/setters.</p>
<p>La <a href="http://www.flashxpress.net/ressources-flex/les-nouveautes-de-flex-4-part-2" target="_self">deuxième partie</a> présente le framework Flex 4 Beta, en particulier la nouvelle architecture de composants et le skinning.</p>
<p><span style="text-decoration: underline;"><strong>Liens et références ayant aidés à réaliser cette présentation</strong></span></p>
<p>Télécharger Flex 4 Beta (IDE + framework)<br />
<a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">http://labs.adobe.com/technologies/flashbuilder4/</a></p>
<p>Télécharger les versions les plus récentes du SDK<br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a></p>
<p>Télécharger Flash Catalyst<br />
<a href="http://labs.adobe.com/technologies/flashcatalyst/" target="_blank">http://labs.adobe.com/technologies/flashcatalyst/</a></p>
<p>Différences Flex3 / Flex4 (avec un guide de migration)<br />
<a href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html</a></p>
<p>L’architecture des composants spark en détails:<br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture</a></p>
<p>Etudes de workflow catalyst / FB4<br />
<a href="http://www.rogue-development.com/blog2/2009/06/a-flash-catalyst-builder-workflow-method/" target="_blank">http://www.rogue-development.com/blog2/2009/06/a-flash-catalyst-builder-workflow-method/</a></p>
<p>Présentation du skinning<br />
<a href="http://www.adobe.com/devnet/flex/articles/flex4_skinning.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flex4_skinning.html</a></p>
<p>Les nouveautés Flash Builder 4<br />
<a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_whatsnew.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flashbuilder4_whatsnew.html</a></p>
<p><em><strong><a href="http://twitter.com/davidderaedt" target="_blank">David Deraedt</a></strong> est développeur, consultant indépendant en Flex et Air et formateur certifié Adobe chez <a title="Regart.net" href="http://www.regart.net/" target="_blank">Regart.net</a>. Il est l’auteur d’un blog de référence sur Flex et AIR (<a href="http://www.dehats.com/drupal/" target="_blank">http://www.dehats.com/drupal/</a>) et fait profiter la communauté de nombreuses applications AIR comme <a href="http://www.dehats.com/drupal/?q=node/58" target="_blank">Lita</a>, un outil d’administration pour SQLLite.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Les nouveautés de Flex 4 [part 1]</title>
		<link>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-1/</link>
		<comments>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-1/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 15:23:50 +0000</pubDate>
		<dc:creator>David Deraedt</dc:creator>
				<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=4286</guid>
		<description><![CDATA[Cette présentation vidéo en deux parties de David Deraedt s’adresse aux développeurs Flex qui désirent d’avoir un aperçu des nouveautés apportées par la version 4 de Flex, actuellement disponible en version Beta.

La première partie s’intéresse à l’environnement de développement Flash builder 4 beta, et expose un certain nombre de nouvelles fonctionnalités telles que le package explorer, ou encore la génération de getter/setters.

La deuxième partie présente le framework Flex 4 Beta, en particulier la nouvelle architecture de composants et le skinning.]]></description>
			<content:encoded><![CDATA[<p><div id="tuto_Flex4_part1">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/tuto_Flex4_part1.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("tuto_Flex4_part1").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/tuto_Flex4_part1.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/tuto_Flex4_part1.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Cette présentation vidéo en deux parties de <a title="David Deraedt" href="http://www.dehats.com/drupal/" target="_blank">David Deraedt</a> s’adresse aux développeurs Flex qui désirent d’avoir un aperçu des  nouveautés apportées par la version 4 de Flex, actuellement disponible  en version Beta.</p>
<p>La <a href="../ressources-flex/les-nouveautes-de-flex-4-part-1/">première partie</a> s’intéresse à l’environnement de développement Flash builder 4 beta, et  expose un certain nombre de nouvelles fonctionnalités telles que le  package explorer, ou encore la génération de getter/setters.</p>
<p>La <a href="../ressources-flex/les-nouveautes-de-flex-4-part-2" target="_self">deuxième partie</a> présente le framework Flex 4 Beta, en particulier la nouvelle architecture de composants et le skinning.</p>
<p><span style="text-decoration: underline;"><strong>Liens et références ayant aidés à réaliser cette présentation</strong></span></p>
<p>Télécharger Flex 4 Beta (IDE + framework)<br />
<a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">http://labs.adobe.com/technologies/flashbuilder4/</a></p>
<p>Télécharger les versions les plus récentes du SDK<br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a></p>
<p>Télécharger Flash Catalyst<br />
<a href="http://labs.adobe.com/technologies/flashcatalyst/" target="_blank">http://labs.adobe.com/technologies/flashcatalyst/</a></p>
<p>Différences Flex3 / Flex4 (avec un guide de migration)<br />
<a href="http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html</a></p>
<p>L’architecture des composants spark en détails:<br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture</a></p>
<p>Etudes de workflow catalyst / FB4<br />
<a href="http://www.rogue-development.com/blog2/2009/06/a-flash-catalyst-builder-workflow-method/" target="_blank">http://www.rogue-development.com/blog2/2009/06/a-flash-catalyst-builder-workflow-method/</a></p>
<p>Présentation du skinning<br />
<a href="http://www.adobe.com/devnet/flex/articles/flex4_skinning.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flex4_skinning.html</a></p>
<p>Les nouveautés Flash Builder 4<br />
<a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_whatsnew.html" target="_blank">http://www.adobe.com/devnet/flex/articles/flashbuilder4_whatsnew.html</a></p>
<p><em><strong><a href="http://twitter.com/davidderaedt" target="_blank">David Deraedt</a></strong> est développeur, consultant indépendant en Flex et Air et formateur certifié Adobe chez <a title="Regart.net" href="http://www.regart.net/" target="_blank">Regart.net</a>. Il est l’auteur d’un blog de référence sur Flex et AIR (<a href="http://www.dehats.com/drupal/" target="_blank">http://www.dehats.com/drupal/</a>) et fait profiter la communauté de nombreuses applications AIR comme <a href="http://www.dehats.com/drupal/?q=node/58" target="_blank">Lita</a>, un outil d’administration pour SQLLite.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/webtv/les-nouveautes-de-flex-4-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Do you Flax ? Le workflow Flash/Flex [part 3]</title>
		<link>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-3/</link>
		<comments>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-3/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 06:30:20 +0000</pubDate>
		<dc:creator>Vincent Maitray</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flax]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=4098</guid>
		<description><![CDATA[Depuis l’apparition de Flex Builder 2 puis 3, de plus en plus de codeurs issus du monde Flash adoptent cet outil de développement qui améliore sensiblement leur quotidien. Si Flex est à ce jour un des tous meilleurs outil pour qui veut développer des RIA ou des sites, il reste extrêmement limité sur le plan du design graphique. De son côté, si Flash n’est pas vraiment satisfaisant pour coder en AS3 (pauvreté de l’éditeur de code), il n’en demeure pas moins un outil de graphisme et d’animation insurpassable pour qui est soucieux du design de ses applications.]]></description>
			<content:encoded><![CDATA[<p><div id="flax_part_3">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/flax_part_3.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("flax_part_3").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/flax_part_3.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/flax_part_3.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Depuis l’apparition de Flex Builder 2 puis 3, de plus en plus de codeurs issus du monde Flash adoptent cet outil de développement qui améliore sensiblement leur quotidien. Si Flex est à ce jour un des tous meilleurs outil pour qui veut développer des RIA ou des sites, il reste extrêmement limité sur le plan du design graphique. De son côté, si Flash n’est pas vraiment satisfaisant pour coder en AS3 (pauvreté de l’éditeur de code), il n’en demeure pas moins un outil de graphisme et d’animation insurpassable pour qui est soucieux du design de ses applications.</p>
<p>Dès lors, comment profiter du meilleur des deux mondes ? Cette série de <strong>trois tutoriels vidéo</strong> fera un tour d’horizon des différentes techniques permettant d’interconnecter ces deux outils : utilisation des métadonnées et des librairies .swc dans Flash, développement de projet Flash avec Flex et design de composants Flex dans Flash.</p>
<p><strong>Dans la troisième partie de ce tutoriel, Vincent Maitray aborde les différentes façons d&#8217;utiliser Flash pour créer l&#8217;habillage graphique de composants Flex :</strong><br />
- les CSS permettant de skinner tous les composants de Flex<br />
- les MovieClipContainer créés dans Flash et qui peuvent contenir des composants Flex<br />
- les UIMovieClip crées dans Flash, sorte de MovieClip utilisables dans Flex</p>
<p><em><strong><a href="http://www.twitter.com/electrofrog">Vincent Maitray</a></strong> est développeur et designer freelance AS3/Flex/Flash Media Server spécialisé dans la vidéo et formateur Flash Media Server/Vidéo chez Regart.net. Il est l’auteur de sites pour des clients comme <a href="http://www.tse-tse.com/" target="_blank">Tse-Tse</a> ou <a href="http://www.petitpan.com/" target="_blank">PetitPan</a> et travaille en collaboration avec des artistes sur des applications artistiques connectées (<a href="http://inmyroom.arte-tv.com/" target="_blank">In my room</a> avec Agnès de Cayeux).</em></p>
<p><em><strong><a href="http://twitter.com/nicolasgans" target="_blank">Nicolas Gans</a></strong> est développeur et designer Flash/ActionScript 3/Flex et formateur certifié Adobe Flash/ActionScript chez Regart.net. Il anime le portail <a href="../">Flashxpress.net</a> et collabore avec des artistes sur des projets de Net Art (<a href="http://www.dotred.fr/" target="_blank">dotred.fr</a>, projet de David Guez).</em></p>
<p>[Ce tutoriel est transposé d'une conférence donnée lors de <a href="../evenement/portes-ouvertes-chez-regartnet-journee-ria/" target="_self">la journée RIA au centre de formation Regart.net le 30 avril 2009</a>]</p>
<p><a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins" target="_blank">Cliquez ici pour télécharger le flex component kit pour Flash CS3</a> évoqué dans le tutoriel.</p>
<p>Les autres parties sont visibles ici :</p>
<p><a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-1/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 1]</a></p>
<p><a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-2/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 2]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Do you Flax ? : le workflow Flash/Flex [part 2]</title>
		<link>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-2/</link>
		<comments>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-2/#comments</comments>
		<pubDate>Fri, 15 May 2009 15:36:25 +0000</pubDate>
		<dc:creator>Nicolas Gans</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=3575</guid>
		<description><![CDATA[Dans la seconde partie de ce tutoriel en trois épisodes sont abordés :
- la création de fichiers .swc dans Flex Builder au travers d'un "Flex Library Project"
- comment faire un projet Flash en codant et en compilant avec Flex Builder au travers d'un "ActionScript Project"
- l'intégration d'une bibliothèque externe (MovieClip créés et animés dans Flash) au sein d'un projet ActionScript Flex via deux méthodes distinctes : l'embed d'un .swf utilisé comme bibliothèque externe et l'utilisation d'une bibliothèque Flash externe compilée en .swc au sein de Flash]]></description>
			<content:encoded><![CDATA[<p><div id="flax_part_2">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/flax_part_2.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("flax_part_2").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/flax_part_2.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/flax_part_2.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Depuis l’apparition de Flex Builder 2 puis 3, de plus en plus de codeurs issus du monde Flash adoptent cet outil de développement qui améliore sensiblement leur quotidien. Si Flex est à ce jour un des tous meilleurs outil pour qui veut développer des RIA ou des sites, il reste extrêmement limité sur le plan du design graphique. De son côté, si Flash n’est pas vraiment satisfaisant pour coder en AS3 (pauvreté de l’éditeur de code), il n’en demeure pas moins un outil de graphisme et d’animation insurpassable pour qui est soucieux du design de ses applications.</p>
<p>Dès lors, comment profiter du meilleur des deux mondes ? Cette série de <strong>trois tutoriels vidéo</strong> fera un tour d’horizon des différentes techniques permettant d’interconnecter ces deux outils : utilisation des métadonnées et des librairies .swc dans Flash, développement de projet Flash avec Flex et design de composants Flex dans Flash.</p>
<p><strong>Dans la seconde partie de ce tutoriel en trois épisodes sont abordés :</strong><br />
- la création de fichiers .swc dans Flex Builder au travers d&#8217;un &laquo;&nbsp;Flex Library Project&nbsp;&raquo;<br />
- comment faire un projet Flash en codant et en compilant avec Flex Builder au travers d&#8217;un &laquo;&nbsp;ActionScript Project&nbsp;&raquo;<br />
- l&#8217;intégration d&#8217;une bibliothèque externe (MovieClip créés et animés dans Flash) au sein d&#8217;un projet ActionScript Flex via deux méthodes distinctes : l&#8217;embed d&#8217;un .swf utilisé comme bibliothèque externe et l&#8217;utilisation d&#8217;une bibliothèque Flash externe compilée en .swc au sein de Flash</p>
<p><em><strong><a href="http://www.twitter.com/electrofrog">Vincent Maitray</a></strong> est développeur et designer freelance AS3/Flex/Flash Media Server spécialisé dans la vidéo et formateur Flash Media Server/Vidéo chez Regart.net. Il est l’auteur de sites pour des clients comme <a href="http://www.tse-tse.com/" target="_blank">Tse-Tse</a> ou <a href="http://www.petitpan.com/" target="_blank">PetitPan</a> et travaille en collaboration avec des artistes sur des applications artistiques connectées (<a href="http://inmyroom.arte-tv.com/" target="_blank">In my room</a> avec Agnès de Cayeux).</em></p>
<p><em><strong><a href="http://twitter.com/nicolasgans" target="_blank">Nicolas Gans</a></strong> est développeur et designer Flash/ActionScript 3/Flex et formateur certifié Adobe Flash/ActionScript chez Regart.net. Il anime le portail <a href="../">Flashxpress.net</a> et collabore avec des artistes sur des projets de Net Art (<a href="http://www.dotred.fr/" target="_blank">dotred.fr</a>, projet de David Guez).</em></p>
<p>[Ce tutoriel est transposé d'une conférence donnée lors de <a href="../evenement/portes-ouvertes-chez-regartnet-journee-ria/" target="_self">la journée RIA au centre de formation Regart.net le 30 avril 2009</a>]</p>
<p>Les autres parties sont visibles ici :</p>
<p><a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-1/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 1]</a><br />
<a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-3/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 3]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Do you Flax ? : le workflow Flash/Flex [part 1]</title>
		<link>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-1/</link>
		<comments>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-1/#comments</comments>
		<pubDate>Fri, 15 May 2009 14:48:44 +0000</pubDate>
		<dc:creator>Nicolas Gans</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=3560</guid>
		<description><![CDATA[Dans la première partie de ce tutoriel en trois épisodes sont abordés :
- l'utilisation des metadonnées Flex dans Flash CS4 et notamment la métadonnée [Embed] qui permet d'inclure des éléments multimédias externes dans un .swf
- la définition et l'intégration de librairies .swc dans Flash CS4
- l'utilisation du framework Flex (package mx.*) à travers l'exemple de la classe WebService issue du rpc.swc : chargement d'un webService via la méthode loadWSDL(), appel des méthodes distantes du webservice et traitement du résultat]]></description>
			<content:encoded><![CDATA[<p><div id="flax_part_1">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/flax_part_1.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("flax_part_1").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/flax_part_1.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/flax_part_1.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Depuis l’apparition de Flex Builder 2 puis 3, de plus en plus de codeurs issus du monde Flash adoptent cet outil de développement qui améliore sensiblement leur quotidien. Si Flex est à ce jour un des tous meilleurs outil pour qui veut développer des RIA ou des sites, il reste extrêmement limité sur le plan du design graphique. De son côté, si Flash n’est pas vraiment satisfaisant pour coder en AS3 (pauvreté de l’éditeur de code), il n’en demeure pas moins un outil de graphisme et d’animation insurpassable pour qui est soucieux du design de ses applications.</p>
<p>Dès lors, comment profiter du meilleur des deux mondes ? Cette série de <strong>trois tutoriels vidéo</strong> fera un tour d’horizon des différentes techniques permettant d’interconnecter ces deux outils : utilisation des métadonnées et des librairies .swc dans Flash, développement de projet Flash avec Flex et design de composants Flex dans Flash.</p>
<p><strong>Dans la première partie de ce tutoriel en trois épisodes sont abordés :</strong><br />
- l&#8217;<strong>utilisation des metadonnées Flex</strong> dans Flash CS4 et notamment la métadonnée [Embed] qui permet d&#8217;inclure des éléments multimédias externes dans un .swf<br />
- la définition et l&#8217;intégration de <strong>librairies .swc</strong> dans Flash CS4<br />
- l&#8217;utilisation du framework Flex (package mx.*) à travers l&#8217;exemple de la <strong>classe WebService issue du rpc.swc</strong> : chargement d&#8217;un webService via la méthode loadWSDL(), appel des méthodes distantes du webservice et traitement du résultat</p>
<p><em><strong><a href="http://www.twitter.com/electrofrog">Vincent Maitray</a></strong> est développeur et designer freelance AS3/Flex/Flash Media Server spécialisé dans la vidéo et formateur Flash Media Server/Vidéo chez Regart.net. Il est l’auteur de sites pour des clients comme <a href="http://www.tse-tse.com/" target="_blank">Tse-Tse</a> ou <a href="http://www.petitpan.com/" target="_blank">PetitPan</a> et travaille en collaboration avec des artistes sur des applications artistiques connectées (<a href="http://inmyroom.arte-tv.com/" target="_blank">In my room</a> avec Agnès de Cayeux).</em></p>
<p><em><strong><a href="http://twitter.com/nicolasgans" target="_blank">Nicolas Gans</a></strong> est développeur et designer Flash/ActionScript 3/Flex et formateur certifié Adobe Flash/ActionScript chez Regart.net. Il anime le portail <a href="../">Flashxpress.net</a> et collabore avec des artistes sur des projets de Net Art (<a href="http://www.dotred.fr/" target="_blank">dotred.fr</a>, projet de David Guez).</em></p>
<p>[Ce tutoriel est transposé d'une conférence donnée lors de <a href="http://www.flashxpress.net/evenement/portes-ouvertes-chez-regartnet-journee-ria/" target="_self">la journée RIA au centre de formation Regart.net le 30 avril 2009</a>]</p>
<p>Les autres parties sont visibles ici :</p>
<p><a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-2/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 2]</a></p>
<p><a href="http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-3/" target="_self">Do you Flax ? Le workflow Flash/Flex [part 3]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/do-you-flax-le-workflow-flashflex-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Application web et application pour le bureau : une distinction obsolète ?</title>
		<link>http://www.flashxpress.net/webtv/application-web-et-application-pour-le-bureau-une-distinction-obsolete/</link>
		<comments>http://www.flashxpress.net/webtv/application-web-et-application-pour-le-bureau-une-distinction-obsolete/#comments</comments>
		<pubDate>Mon, 11 May 2009 14:46:32 +0000</pubDate>
		<dc:creator>David Deraedt</dc:creator>
				<category><![CDATA[Conférence]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[WebTV]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=3450</guid>
		<description><![CDATA[Ces dernières années ont été marquées par l’avènement du navigateur en tant qu’environnement d’exécution d’applications, par opposition au modèle traditionnel qui voulait que celles-ci s’exécutent directement sur le bureau.]]></description>
			<content:encoded><![CDATA[<p><div id="ria_conf_david">
<video controls="controls" width="630" height="473">
<source src="http://ks358667.kimsufi.com/~video/webtv/iPhone/ria_conf_david.mp4" type="video/mp4" />
</video>
</div>
<script type="text/javascript">
jwplayer("ria_conf_david").setup({
flashplayer: "http://www.flashxpress.net/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
file: "http://ks358667.kimsufi.com/~video/webtv/ria_conf_david.f4v",
image: "http://ks358667.kimsufi.com/~video/webtv/posters/ria_conf_david.f4v.jpg",
width: 630,
height: 473
});
</script>
<p>&nbsp;</p>
</p>
<p>Ces dernières années ont été marquées par l’avènement du navigateur en tant qu’environnement d’exécution d’applications, par opposition au modèle traditionnel qui voulait que celles-ci s’exécutent directement sur le bureau. Mais, aujourd’hui, des technologies comme <a href="http://www.adobe.com/fr/products/air/" target="_blank">Adobe AIR</a> permettent d’exécuter sur ce même bureau des application basées sur les technologies du web, telles que Flash et HTML. Cette tendance a pu sembler anachronique, voire paradoxale, pour certains observateurs. Mais n’est-ce pas plutôt la pertinence de la distinction entre ces deux types d’application qui serait remise en cause ?</p>
<p><em><strong><a href="http://twitter.com/davidderaedt" target="_blank">David Deraedt</a></strong> est développeur, consultant en Flex et Air et formateur certifié Adobe chez Regart.net. Il est l’auteur d’un blog de référence sur Flex et AIR (<a href="http://www.dehats.com/drupal/" target="_blank">http://www.dehats.com/drupal/</a>) et fait profiter la communauté de nombreuses applications AIR comme <a href="http://www.dehats.com/drupal/?q=node/58" target="_blank">Lita</a>, un outil d’administration pour SQLLite.</em></p>
<p>[Conférence donnée lors de la <a href="http://www.flashxpress.net/focus/portes-ouvertes-chez-regartnet-journee-ria/">journée RIA</a> au centre de formation <a href="http://www.regart.net" target="_blank">Regart.net</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/webtv/application-web-et-application-pour-le-bureau-une-distinction-obsolete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La classe StageResizeManager</title>
		<link>http://www.flashxpress.net/ressources-flash/la-classe-stageresizemanager/</link>
		<comments>http://www.flashxpress.net/ressources-flash/la-classe-stageresizemanager/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 12:04:27 +0000</pubDate>
		<dc:creator>Vincent Maitray</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/news/la-classe-stageresizemanager/</guid>
		<description><![CDATA[Source : electrofrog.com Dernièrement lors de la réalisation d’un projet, j’ai eu besoin d’utiliser l’évènement RESIZE de la classe Stage, mais je n’étais pas entièrement satisfait de son fonctionnement. En effet, il est diffusé de manière répétée (et incontrôlable…) lorsque l’utilisateur redimensionne la scène, et cela était parfaitement incompatible avec ce que je voulais faire, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.electrofrog.com">Source : electrofrog.com</a></p>
<p>Dernièrement lors de la réalisation d’un projet, j’ai eu besoin d’utiliser l’évènement RESIZE de la classe Stage, mais je n’étais pas entièrement satisfait de son fonctionnement. En effet, il est diffusé de manière répétée (et incontrôlable…) lorsque l’utilisateur redimensionne la scène, et cela était parfaitement incompatible avec ce que je voulais faire, à savoir une boucle sur plusieurs dizaines de Sprites avec repositionnement de chacun d’entre eux + mouvement. J’ai donc crée cette petite classe StageResizeManager qui diffuse un évènement au début du resize (RESIZE_START), puis ensuite l’évènement classique est diffusé de manière répétitive lors du redimensionnement (notez qu’il ne s’appelle plus RESIZE mais RESIZE_PROGRESS ) et enfin un dernier évènement (RESIZE_END) est diffusé à la fin du redimensionnement, c’est à dire n millisecondes après la fin de détection de mouvement de souris continu lors d’un resize. C’est lui qu’il est intéressant d’écouter.</p>
<p>La classe est un singleton, et la méthode qui permet de l’instancier prend deux paramètres. Le premier, pStage est obligatoire  et c’est la référence à la scène, le second est facultatif, sa valeur par défaut est de 250ms, et représente le délai après lequel l’évènement RESIZE_END est diffusé.</p>
<p>Le fichier d’exemple qui contient la classe est un projet Flex 3 qui ne fait rien d’autre que de tracer PIM, PAM et POUM en fonction des évènements diffusés. Cette classe n’utilise aucune particularité du framework Flex, elle est donc entièrement compatible avec tout projet en AS3.</p>
<p>################# edit du 8/05/2009<br />
Après plusieurs demandes, j&#8217;ai ajouté les sources au format Flash CS3/CS4</p>
<p><a href="http://www.electrofrog.com/blog/wp-content/uploads/2009/04/stageresizemanagerexample.zip"><img class="alignnone size-medium wp-image-197" title="telecharger_code_source" src="http://www.electrofrog.com/blog/wp-content/uploads/2009/04/file_flex.png" alt="telecharger_code_source_flex" width="128" height="40" /></a></p>
<p><a href="http://www.electrofrog.com/blog/wp-content/uploads/2009/04/stageresizemanager_flash_example.zip"><img class="alignnone size-medium wp-image-197" style="clear:both;" title="telecharger_code_source" src="http://www.electrofrog.com/blog/wp-content/uploads/2009/04/file_fla.png" alt="telecharger_code_source_flash" width="128" height="40" /></a></p>
<div>
<div>
<div style="clear:both;">

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p3131code2'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p31312"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
</pre></td><td class="code" id="p3131code2"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//-----------------------------------------------------------------------------------</span>
&nbsp;
<span style="color: #3f5fbf;">/*
	Copyleft (¢) 2009  Vincent Maitray - www.electrofrog.com
&nbsp;
	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the &quot;Software&quot;), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:
&nbsp;
	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.
&nbsp;
	THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
&nbsp;
	Mention to the author would be appreciated !
*/</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//-----------------------------------------------------------------------------------</span>
&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>electrofrog<span style="color: #000066; font-weight: bold;">.</span>utils
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>electrofrog<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>StageResizeManagerEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stage%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stage.html"><span style="color: #004993;">Stage</span></a><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=eventdispatcher%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:eventdispatcher.html"><span style="color: #004993;">EventDispatcher</span></a><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html"><span style="color: #004993;">TimerEvent</span></a><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.ui</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=mouse%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouse.html"><span style="color: #004993;">Mouse</span></a><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html"><span style="color: #004993;">Timer</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * Handle the resize process of the stage more accuratly than the simple Event.resize event.
	 *
	 * @param pStage The stage instance to be listen to.
	 * @param pResizeEndDelay The delay in ms after which the ResizeManagerEvent.STAGE_RESIZE_END event is dispatched.
	 *
	 * @author Vincent Maitray
	 * @date April 03, 2009.
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StageResizeManager <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=eventdispatcher%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:eventdispatcher.html"><span style="color: #004993;">EventDispatcher</span></a>
	<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> _instance<span style="color: #000066; font-weight: bold;">:</span>StageResizeManager<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _stage<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=stage%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stage.html"><span style="color: #004993;">Stage</span></a><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _t1<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html"><span style="color: #004993;">Timer</span></a><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _resizeEndDelay<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Method for instanciating this class as a Singleton
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getinstance<span style="color: #000000;">&#40;</span> pStage<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=stage%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stage.html"><span style="color: #004993;">Stage</span></a><span style="color: #000066; font-weight: bold;">,</span> pResizeEndDelay<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">250</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>StageResizeManager
		<span style="color: #000000;">&#123;</span>	
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #000066; font-weight: bold;">!</span>_instance <span style="color: #000000;">&#41;</span>
				_instance = <span style="color: #0033ff; font-weight: bold;">new</span> StageResizeManager<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> SingletonEnforcer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> pStage<span style="color: #000066; font-weight: bold;">,</span> pResizeEndDelay <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _instance<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * hidden constructor.
		 * @private
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StageResizeManager<span style="color: #000000;">&#40;</span> se<span style="color: #000066; font-weight: bold;">:</span>SingletonEnforcer<span style="color: #000066; font-weight: bold;">,</span> pStage<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=stage%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stage.html"><span style="color: #004993;">Stage</span></a><span style="color: #000066; font-weight: bold;">,</span> pResizeEndDelay<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> <span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #000066; font-weight: bold;">!</span>se <span style="color: #000000;">&#41;</span>
				<span style="color: #0033ff; font-weight: bold;">throw</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a><span style="color: #000000;">&#40;</span> <span style="color: #990000;">&quot;operator 'new' is not not allowed with singleton classes. Use ResizeManager.getInstance() instead !&quot;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			_stage = pStage<span style="color: #000066; font-weight: bold;">;</span>
			_resizeEndDelay = pResizeEndDelay<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			_stage<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">RESIZE</span><span style="color: #000066; font-weight: bold;">,</span> onStageResize <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			_t1 = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html"><span style="color: #004993;">Timer</span></a><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html"><span style="color: #004993;">TimerEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TIMER</span><span style="color: #000066; font-weight: bold;">,</span> onTimer <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Fired when the user resizes the stage
		 *
		 * @param e Event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onStageResize<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000066; font-weight: bold;">!</span>_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">running</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
&nbsp;
				<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> StageResizeManagerEvent<span style="color: #000000;">&#40;</span> StageResizeManagerEvent<span style="color: #000066; font-weight: bold;">.</span>STAGE_RESIZE_START<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
&nbsp;
				<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> StageResizeManagerEvent<span style="color: #000000;">&#40;</span> StageResizeManagerEvent<span style="color: #000066; font-weight: bold;">.</span>STAGE_RESIZE_PROGRESS<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Fired each pResizeEndDelay ms ( eg 250 ) when the timer is running.
		 *
		 * @param e Event
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onTimer<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html"><span style="color: #004993;">TimerEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> t<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html"><span style="color: #004993;">Timer</span></a> = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span> <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html"><span style="color: #004993;">Timer</span></a>
			<span style="color: #6699cc; font-weight: bold;">var</span> count<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = t<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentCount</span> <span style="color: #000066; font-weight: bold;">*</span> t<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">delay</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> count <span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span> _resizeEndDelay <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
&nbsp;
				_t1<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> StageResizeManagerEvent<span style="color: #000000;">&#40;</span> StageResizeManagerEvent<span style="color: #000066; font-weight: bold;">.</span>STAGE_RESIZE_END<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #3f5fbf;">/**
 * Dummy class, part of the Singleton subsystem
 */</span>
<span style="color: #9900cc; font-weight: bold;">class</span> SingletonEnforcer
<span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</div>
</div>
</div>
<div>
<ul>
<li><a href="http://www.addtoany.com/share_save?sitename=vincent%20maitray&amp;siteurl=http%3A%2F%2Fwww.electrofrog.com%2F&amp;linkname=La%20classe%20StageResizeManager&amp;linkurl=http%3A%2F%2Fwww.electrofrog.com%2F2009%2F04%2Fla-classe-stageresizemanager%2F"><img src="http://www.electrofrog.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" alt="Share/Save/Bookmark" width="120" height="16" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/la-classe-stageresizemanager/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>addFrame &#8211; Code-moi une Timeline en AS3</title>
		<link>http://www.flashxpress.net/ressources-flash/addframe-code-moi-une-timeline-en-as3/</link>
		<comments>http://www.flashxpress.net/ressources-flash/addframe-code-moi-une-timeline-en-as3/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:39:08 +0000</pubDate>
		<dc:creator>alama</dc:creator>
				<category><![CDATA[Flash ActionScript]]></category>
		<category><![CDATA[Tutoriels Flash]]></category>
		<category><![CDATA[Tutoriels Flex]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Timeline]]></category>

		<guid isPermaLink="false">http://www.flashxpress.net/?p=2792</guid>
		<description><![CDATA[Ce tutorial à pour but d&#8217;expliquer comment créer une Timeline en AS3, soit plusieurs images en root de l&#8217;application sans utiliser Flash. Mais uniquement par code avec le compilateur mxmlc.exe fournit avec le Flex SDK. Approche de conception d&#8217;une application Il existe deux types de créateurs de sites Web, il y a ceux qui divisent [...]]]></description>
			<content:encoded><![CDATA[<p>Ce tutorial à pour but d&#8217;expliquer comment créer une <span style="color: #000000;"><strong>Timeline </strong></span>en <strong>AS3</strong>, soit plusieurs images en root de l&#8217;application sans utiliser Flash. Mais uniquement par code avec le compilateur<strong> mxmlc.exe</strong> fournit avec le Flex SDK.</p>
<h3><strong>Approche de conception d&#8217;une application</strong></h3>
<p>Il existe deux types de créateurs de sites Web, il y a ceux qui divisent leur application en une série de SWF autonomes, qui les chargent ensuite dans un SWF principal et le tout étant propulsé par un script unique, de nos jours, une classe document.</p>
<p>Et d&#8217;autres préfèrent  utiliser la timeline de flash et considérent les Frames comme des écrans :<br />
frame1 = préloader, frame 2 = écran accueil, frame3 = Biographie, etc. Et naviguer d&#8217;un écran à l&#8217;autre à l&#8217;aide <span style="color: #0000ff;">gotoAndStop()</span> en fonction des clicks utilisateur.</p>
<p>Une méthode est elle meilleure que l&#8217;autre ? Bof, je ne pense pas, c&#8217;est surtout dépendant de l&#8217;application à réaliser et des affinités du réalisateur avec le code AS3 ou l&#8217;IDE Flash. La deuxième est du code spaghettis ? Pas forcément, cela peut être très propre, même si plusieurs images clefs avec code, comme il y a moyen de faire du code spaghettis au sein d&#8217;un script unique.</p>
<p>D&#8217;ailleurs, la deuxième méthode s&#8217;apparente aux &laquo;&nbsp;<span style="color: #0000ff;">States</span>&nbsp;&raquo; de <strong>Flex </strong>, dans Flex, c&#8217;est la seule possibilité de modifier certaines propriétés de contrôles qui sont <strong>impossibles à changer au RunTime</strong>.</p>
<p>Attention toutefois que la deuxième méthode va recharger et réinstancier les éléments instanciés par code, il faut vérifier l&#8217;état de mémoire et regarder à ne pas la surcharger par des redondances au fil de la navigation.</p>
<p>Même en utilisant la première méthode, une Timeline de 2 images est intéressante afin de faire un preloader intégré à la Main application.</p>
<p>Dès lors, est-il possible de créer plusieurs images clefs par code?</p>
<h3><strong>Sous Flash .. « Dessine moi une Timeline.. »</strong></h3>
<p>Sous Flash, rien de plus simple, on crée les frames nécessaires, on place les éléments, le code et on compile.</p>
<p>Mais justement, comment Flash fait il ? Car c&#8217;est en wysiwyg et le code ou les directives de création de frames nous échappent.</p>
<p>Créons un FLA « test.fla », créons 2 images Clefs vides et compilons. Nous obtenons un SWF contenant 2 frames vides, rien d&#8217;autre.<br />
A présent, ajoutons une instruction <span style="color: #0000ff;">stop()</span> ; sur chaque frame. Nous obtenons un SWF avec <strong>2 Frames</strong> vides et une Classe <strong>MainTimeline </strong>que voici :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2792code6'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27926"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p2792code6"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> test_fla
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
    dynamic <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MainTimeline <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a>
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MainTimeline<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            addFrameScript<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>frame1<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>frame2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> frame1<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> frame2<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>En AS2, on aurait trouvé 2 frames avec du code dans chaque frame. En AS3, les choses sont différentes ! Flash crée une classe document et le code associé à chaque frame est une fonction dont la référence est ajoutée par code à chaque frame vide. Ce qui nous permet de découvrir l&#8217;instruction <span style="color: #0000ff;">addFrameScript</span>.</p>
<p>Si on consulte la classe <strong>MovieClip</strong> du <strong>globalPlayer.swc</strong>, on trouve cette méthode. Elle est donc bien accessible que via la classe MovieClip, voilà, pourquoi, une classe possèdant une <strong>Timeline </strong>doit forcément étendre <strong>MovieClip </strong>et non <strong>Sprite </strong>qui est au départ la valeur par défaut que le player instancie afin de créer la scène d&#8217;affichage.</p>
<h3><strong>En AS3 ..  « Code moi une Timeline.. »</strong></h3>
<p>Pas de problème, vous créer une <span style="color: #0000ff;">MainClass </span>qui étend <span style="color: #0000ff;">MovieClip</span>. Vous tracez la propriété <span style="color: #0000ff;">totalFrames </span>et vous constatez qu&#8217;il  y a <strong>1 frame</strong> par défaut. Qu&#8217;à cela ne tienne, vous aller dans la doc chercher cette fameuse méthode <strong>addFrame </strong>ou équivalent.. C&#8217;est là que ça se complique.. vous n&#8217;en trouvez pas !<br />
Vous essayer d&#8217;utiliser <span style="color: #0000ff;">addFrameScript</span>, peut être que le compilateur va créer les frames en fonction de ça.. Vous compilez et..  Kedal, nada, zero !! toujours <strong>1 frame</strong> :S</p>
<p>La classe MovieClip possède bien en Array scenes, mais il est en lecture seule! Donc, même on créeant un objet à l&#8217;aide la classe Scene, impossible de l&#8217;ajouter à l&#8217;objet MovieClip.</p>
<p>Flash crée plusieurs images Clefs!!, donc, soit, il utilise des instructions cachées, soit une directive de compilation cachée, soit un argument à l&#8217;invocation du compilateur.. !? A moins que le compilateur de Flash soit différent du mxmlc??</p>
<p>On pourrait envisager d&#8217;écrire une classe Timeline qui imiterait toutes les propriétés et méthodes de la classe MovieClip en y ajoutant <strong>addFrame </strong>etc.<br />
<strong>Mais cela ne sera pas une vraie timeline exécutée automatiquement par le player</strong>..</p>
<p>On ouvre une console DOS, on lance la commande:  <strong>mxmlc.exe -help -advanced -details</strong></p>
<p>Et là, une longue liste d&#8217;arguments apparaît.. on scrute.. mais pas le moindre signe <strong>addFrame </strong>ou <strong>addScene </strong>à l&#8217;horizon.. Sauf quand même qu&#8217;une commande attire notre attention.. La commande</p>
<p><strong>-frame.frame</strong> ayant l&#8217;alias <strong>-frame</strong>.</p>
<p>Sous <a href="http://www.flashdevelop.org/community/" target="_blank">FlashDevelop</a>, on crée un nouveau projet AS3,  on ouvre les <strong>propriétés </strong>du projet, onglet <strong>Compiler Options</strong>, et dans <strong>Additional Compiler Options</strong>, on ajoute :</p>
<p><strong>-frame frame2 Main</strong></p>
<p>Comme il est <strong>obligatoire </strong>de passer un Label et une classe à associer en paramètre, on l&#8217;appelle <strong>frame2</strong> et on lui passe la classe <strong>Main </strong>en se disant qu&#8217;il ne la dupliquera pas et que cela aura le même effet qu&#8217;ajouter une image en Flash par la touche F5.</p>
<p>On étend la classe MovieClip et on ajoute un test du nombre de frames :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2792code7'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27927"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p2792code7"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a>
    <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">totalFrames</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>On compile, les yeux rivés sur la fenêtre Output.. et là, un chiffre apparaît ! on peut lire « <strong>2 </strong>» !! :D</p>
<p><strong>Génial !! Ca y est !!! Ca fonctionne!!</strong> On a bien <strong>2 frames </strong><strong> !!</strong></p>
<p>Ensuite, on va ajouter du code lié aux frames  comme ceci :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2792code8'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27928"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code" id="p2792code8"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a>
    <span style="color: #000000;">&#123;</span>	
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">totalFrames</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			addFrameScript<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> frame1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			addFrameScript<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> frame2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> frame1<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
        <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>currentFrameLabel<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">nextFrame</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> frame2<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
        <span style="color: #000000;">&#123;</span>
                        <span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>currentFrameLabel<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span><span style="color: #009900; font-style: italic;">// end function</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>On teste et tout va bien ! On a créé <strong>en code une vraie Timeline</strong>, on peut addChilder des objets dans chaque frame et y associer du code.. Voilà, c&#8217;est parfait pour un preloader en <strong>frame1 </strong>et le reste en <strong>frame2</strong>.</p>
<h3><strong>Conclusion</strong></h3>
<p>Il est tout à fait possible de créer une Timeline de la manière vue ci avant, pour ajouter des frames, il faut <strong>répéter </strong>l&#8217;option de compilation <strong>-frame Label Class </strong>autant de fois que de frame désirés.</p>
<p><strong>-frame frame2 Main<br />
-frame frame3 Main<br />
-frame frame4 Main<br />
..</strong></p>
<p>Etant donné que pour chaque frame, on doit associer une classe, il peut être plus simple de créer une classe pour chaque frame et de ne plus utiliser les <span style="color: #0000ff;">addFrameScript </span>dans la classe de <strong>frame1</strong></p>
<p>Exemple, on peut créer les classes  Frame1.as, Frame2.as, frame3.as, etc Et les associer aux frames correspondants.  <strong>Frame1 étant la classe document</strong>.</p>
<p><strong>La classe devant contrôler la tête de lecture ou devant utiliser des méthodes ou propriétés de MovieClip devra étendre MovieClip</strong>, Dans les autres cas, les frames peuvent étendre <span style="color: #0000ff;">Sprite</span>, il n&#8217;y aura pas d&#8217;erreur de compilation, cela suffit si elle ne sont destinées qu&#8217;a addChilder des objets.</p>
<p>Il est tout à fait possible de créer un SWF dont la classe document est un <span style="color: #0000ff;">Sprite </span>et contenant une <span style="color: #0000ff;">Timeline </span>de plusieurs frames, le SWF fonctionnera, il lira la timeline en boucle, mais aucune méthode ni propriété de Movieclip ne sera accessible, nous n&#8217;aurons aucun contrôle dessus, même pas un <span style="color: #0000ff;">stop()</span> et surtout,<strong> impossible d&#8217;y insérer du code</strong>. Si on essaye quand même, <strong>cela générera une erreur de compilation</strong>.</p>
<p>Les gens aimant le principe des frames représentant les états de leurs applications peuvent le faire en AS3 pur ! ;)</p>
<p>Ceux qui aiment avoir un <strong>Preloader en frame1 </strong>et <strong>le reste en frame2</strong> seront également ravis.. dans ce cas, la classe Preload devra être la documentClass et étendre MovieClip.</p>
<p>De cette manière on peut créer l&#8217;équivalent des symboles MovieClip sous forme de SWF.<br />
Ceux qui possèdent Flash peuvent faire leurs MC dans Flash et exporter en SWC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashxpress.net/ressources-flash/addframe-code-moi-une-timeline-en-as3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

