Profitez pleinement de toute la puissance d’Adobe Flash en développant vos connaissances de l’ActionScript 3. Formez-vous pas à pas sur ce langage de programmation orienté objet avant de mettre en œuvre vos connaissances sur plusieurs applications pratiques proposées par l’auteur. Damien LAURENT développeur Flash et formateur certifié Adobe (ACI), vous enseigne de façon très progressive et pédagogique toutes les notions fondamentales nécessaires pour maîtriser l’ActionScript 3 et créer vos propres applications. Des fichiers sources liés aux exercices accompagnent cette formation. (Durée 8h25). Sommaire de la formation Apprendre ActionScript 3 : Présentation vidéo Mot de l’auteur
Introduction Présentation de l’Action Script 3 • Organisation des dossiers dans une structure projet • Les paramètres de publication • Les machines virtuelles du Flash Player • La place du code • Commenter son code • Le principe de la compilation • Les erreurs de compilation et d’exécution • Nommer correctement les éléments • Rédaction d’instructions
Les variables Le rôle des variables : application dans une animation • Variables et constantes, syntaxe et fonction trace() • Les classes, types de données et typage strict • Les variables contenant du texte • Les variables contenant des nombres • Les Valeurs booléennes • Le type * (étoile) • Le comportement de l’opérateur «+» avec le texte ou les nombres • La conversion de données • Les valeurs par défaut selon les types
Les fonctions Le rôle des fonctions • La rédaction d’une fonction • Les paramètres • Retourner des valeurs • Paramètres facultatifs et reste • Variables globales et variables locales
Notions d’objet Classes, packages, occurrences et syntaxe pointée • Syntaxe à crochets • La construction d’occurences • Les méthodes et propriétés d’occurrence ou de classe (statique) • Les classes d’énumération • Les classes dynamiques et propriétés dynamiques • Comprendre l’héritage de classes • Références, types primitifs, types complexes
Les conditions Les valeurs booléennes dans les conditions • L’instruction ‘if’ • Vérifier le type de donnée d’un objet • Les opérateurs logiques et conditions multiples • L’opérateur ‘not’ • L’instruction ‘else’ • L’instruction ‘else if’ • L’instruction ‘switch’ • L’opérateur ternaire ‘?:’
L’affichage - Partie 1 Organisation de la hiérarchie d’affichage • Les différents objets d’affichage • Affichage d’un objet • Exporter des éléments de la bibliothèque pour ActionScript • Affichage d’une image de la biblio, classe BitmapData et Bitmap • Affichage d’un clip de la biblio, classe MovieClip • Manipulation de l’affichage
Gestion évènementielle Comportements synchrones et asynchrones • Comprendre la notion d’évènements • Syntaxe générique pour ajouter un écouteur d’évènement • Quels évènements sont distribués par quels objets ? • Ajout et suppression d’écouteurs d’évènements • Propriétés relatives au évènements • Propagation des évènements dans la liste d’affichage
Gérer des collections d’objets Les classes Array et Vector
Les boucles La boucle for • Les boucles for each..in et for..in (objets dynamiques) • Les boucles while et do..while
L’affichage - Partie 2 Menu contextuel sur les objets graphiques • Les Filtres • Les Modes de fusion • DisplayObject, propriétés parent, root et stage • L’affichage «Full Flash» • Le chargement de SWF et d’images • Le nettoyage des swf chargés puis déchargés
Mise en forme du texte Mettre en forme avec la classe TextFormat • Utiliser HTML et CSS • Intégration de polices de caractères
Son Présentation des classes Sound et Sound Channel • La lecture d’un son (intégré ou externe) • Modification du volume et du panoramique • Déplacement dans un son
Le débogueur de Flash Suivre l’exécution d’un code avec le débogueur
Gestion des erreurs à l’exécution Les codes d’erreurs • Les classes d’erreurs • Prévoir les possibilités d’erreur grâce à la documentation • Gérer les erreurs : Utilisations de blocs try/catch • Lancer des erreurs
Gestion de la mémoire Garbage Collector et références • Cas des écouteurs d’évènements • Tester l’utilisation mémoire
Application : Drag and Drop Présentation de l’application • Méthodes startDrag et stopDrag • mouseEnabled et mouseChildren • La propriété ‘buttonMode’ • casting, contrainte de type • target et currentTarget
Application : Diaporama Présentation de l’application • Navigation et classes Array et Object : traiter des collections d’objets • Présentation du format XML • Chargement d’un fichier XML • Accéder aux données XML, les convertir, remplir la liste Array • Finalisation de la navigation • Opérateurs de pre/post incrémentation et décrémentation et opérateur affection composée arythmétique
Application : générateur de particules Présentation de l’application • Animation avec l’évènement EnterFrame • Création d’une collection d’objets : Boucle for • Manipulation de la collection d’objets : Boucle for each..in • Comportements aléatoires avec Math.random() • Trier un tableau contenant des objets • Gérer les limites de la scène • Optimisation de l’affichage avec cacheAsBitmap • Conclusion
Application : Formulaire Présentation de l’application • Gestion des tabulations • Validation des entrées • Evènements focus • Evènements clavier • Envoyer des variables vers une URL
Application : Jeu de grattage Présentation de l’application et classe BitmapData • Capturer la représentation graphique d’un objet • Masque d’opacité • Evenements_souris • Matrice de transformation et instruction ‘switch’ • Afficher/masquer le curseur souris • Validation du grattage • La classe Timer • Conclusion
Conclusion Conclusion de la formation •