Home Shuffle
 
 
Ce site est un pêle-mêle des activités graphiques, artistiques et multimédia de Linh Hoang.
Le meilleur, mais aussi le pire !

Autre
site
de
l'auteur :



Les noms cités sur ce site internet sont des marques déposées ou des marques commerciales appartenant à leurs propriétaires respectifs.

Utilitaires :

Nuancier
Pantone



Aide-mémoire :
As3
Php
Css

Page : 33 / 63
Précédente |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| Suivante


Posté le 2009-12-02 - à 23:44 - Par Linh. id post : 268.
Abstraction 214.




Date de cration : 03-09-2006. Format : 30F. Dimensions : 92 x 73 cm. Acrylique sur chassis entoil.

2 nues roses.


Posté le 2009-12-01 - à 23:30 - Par Linh. id post : 201.
Mon premier script As3.


Un grand merci Marcello Pettino pour le graphisme grunge de l'ipod.


Mes premiers pas en ActionScript3. Il n'a pas t facile de s'adapter cette nouvelle version de l'ActionScript. On passe aisment du rire aux larmes.

Le code html.


Le fichier playlist.xml.


Le fichier crossdomain.xml est a mettre au premier niveau de votre site. Ce fichier gre les rgles d'autorisation inter-domaine.


Le code ActionScript3
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.display.Sprite;
import flash.net.*;

play0.visible=true;
stop0.visible=false;
var externalXML:XML;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("http://VotreNomDeDomaine.com/playlist.xml");
loader.load(request);
loader.addEventListener(Event.COMPLETE, onComplete);

function onComplete(event:Event):void {
var loader:URLLoader = event.target as URLLoader;
if (loader != null) {
externalXML = new XML(loader.data);
var combien:int = externalXML.chanson.length();
var nombreAlea:int = Math.floor(Math.random()*combien);

var songs:Array = new Array();
var i:int;
for (i = 0; i < combien; i++) {
songs[i] = externalXML.chanson[i].nom;
}
var nomMP3:Array = new Array();
for (i = 0; i < combien; i++) {
nomMP3[i] = externalXML.chanson[i].fichier;
}
play0.visible=true;
stop0.visible=false;
bar0.flecheNo.visible=false;
var pausePosition:int;
var son:Sound = new Sound();
var req:URLRequest = new URLRequest("http://VotreNomDeDomaine.com/" + nomMP3[nombreAlea]);
var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
var channel:SoundChannel = new SoundChannel();
son.load(req, context);
var etat:Boolean = true;
var bounds:Rectangle;
bounds = new Rectangle(0,0,100,0);

bar0.fleche.addEventListener(MouseEvent.MOUSE_DOWN, onDrag);
bar0.fleche.addEventListener(MouseEvent.MOUSE_UP, endDrag);
function onDrag(event:MouseEvent):void {
bar0.fleche.startDrag(false,bounds);
etat = false;
channel.stop();
}
function endDrag(event:MouseEvent):void {
bar0.fleche.stopDrag();
pausePosition = (son.length/100)*bar0.fleche.x;
channel = son.play(pausePosition);
etat = true;
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
play0.addEventListener(MouseEvent.CLICK, clickPlay);
stop0.addEventListener(MouseEvent.CLICK, clickStop);
web.addEventListener(MouseEvent.CLICK, clicURL);
channel.addEventListener(Event.SOUND_COMPLETE, onPlayComplete);
var estimatedLength:int = Math.ceil(son.length / (son.bytesLoaded / son.bytesTotal));
var playbackPercent:uint = Math.round(100 * (channel.position / estimatedLength));
titre.text = "Title: " + songs[nombreAlea];
temps.text = "Total length: " + Math.ceil(estimatedLength/1000) + "'";
pourcent.text = "Playing: "+playbackPercent+"%";
if (etat) {
bar0.fleche.x = playbackPercent;
bar0.flecheNo.x = playbackPercent;
}
}

function onPlayComplete(event:Event):void {
play0.visible=true;
stop0.visible=false;
pausePosition = 0;
etat = true;
bar0.fleche.visible=false;
bar0.flecheNo.visible=true;
}
function clickPlay(event:Event):void {
play0.visible=false;
stop0.visible=true;
channel = son.play(pausePosition);
bar0.fleche.visible=true;
bar0.flecheNo.visible=false;
}
function clickStop(event:Event):void {
play0.visible=true;
stop0.visible=false;
pausePosition = channel.position;
channel.stop();
bar0.fleche.visible=false;
bar0.flecheNo.visible=true;
}
} else {
titre.text = "Error!";
}
}

function clicURL(event:Event):void {
var url:String = "http://www.mailanhoang.com/creerlien.php";
var request:URLRequest = new URLRequest(url);
navigateToURL(request,"_blank");
}


Poster un commentaire | 0 commentaire | Top |

Posté le 2009-11-29 - à 11:49 - Par Linh. id post : 263.
Charlie Chaplin. Bandit manchot 1.


Cd-rom culturel interactif. Une production Infogrames Multimdia. Copyright tous droits rservs.



Extrait du Cd-rom Charlie Chaplin.

Le code ActionScript2
sonGagne=new Sound(); sonGagne.attachSound("sonGagne"); sonGagne.stop();
sonPerdu=new Sound(); sonPerdu.attachSound("sonPerdu"); sonPerdu.stop();
sonRejouer=new Sound(); sonRejouer.attachSound("sonRejouer"); sonRejouer.stop();
attachMovie("fond1","fond1",0);
attachMovie("bas","bas",1); bas._y=416;
attachMovie("filet","filet",10001);
attachMovie("zz0","zz1",400); zz1._x=265; zz1._y=140;
attachMovie("zz0","zz2",401); zz2._x=9000; zz2._y=240;
typoDeb();
zz1.onPress=function(){ sonRejouer.start(); debPlay(); }
zz2.onPress=function(){ sonRejouer.start(); debPlay(); }
// bloc texte deb
function typoDeb(){
createEmptyMovieClip("tDeb",2);
with(tDeb){
createTextField("tPuzzle",2,180,80,400,300);
tPuzzle.text="Manchot"; tPuzzle.embedFonts=true; tPuzzle.selectable=false;
tPuzzleF=new TextFormat(); tPuzzleF.font ="Verdana"; tPuzzleF.size =55; tPuzzleF.color=0x009900;
tPuzzle.setTextFormat(tPuzzleF);

createTextField("tPlay",3,250,120,300,300);
tPlay.text="Jouer?"; tPlay.embedFonts=true; tPlay.selectable=false;
tPlayF=new TextFormat(); tPlayF.font ="Verdana"; tPlayF.size =30; tPlayF.color=0x000000;
tPlay.setTextFormat(tPlayF);
}}

function debPlay(){
gain=4;
tDeb._x=9000;
fondFin._x=9000;
zz1._x=9000;
zz2._x=9000;

attachMovie("fond2","fond2",6);
attachMovie("fondPoint","fondPoint",7); fondPoint._alpha=75;

createTextField("tGain",310,115,5,200,200);
tGain.text=gain+"$"; tGain.embedFonts=true; tGain.selectable=false;
tGainF=new TextFormat(); tGainF.font ="Arial Black"; tGainF.size =50; tGainF.color=0xFFFFFF; tGainF.align="center";
tCentF=new TextFormat(); tCentF.size =40; tCentF.color=0x66CC33;
tGain.setTextFormat(tGainF); tGain.setNewTextFormat(1,10,tCentF);

for(i=1;i<=3;i++){ attachMovie("b"+i,"b"+i,202+i); eval("b"+i)._y=126; }
b1._x=130; b2._x=265; b3._x=400;
for(i=1;i<=3;i++){ attachMovie("alea"+i,"alea"+i,212+i); with(eval("alea"+i)){ _y=126; _visible=false; }}
alea1._x=130; alea2._x=265; alea3._x=400;

attachMovie("manche","manche",201); with(manche){ _x=551; _y=121; }

manche.onPress=function(){
for(i=1;i<=3;i++){
with(eval("alea"+i)){ _visible=true; }
eval("b"+i).removeMovieClip();
}}
manche.onRelease=manche.onReleaseOutside=function(){
listeFig=new Array(random(3)+1,random(3)+1,random(3)+1);
total=listeFig[0]+listeFig[1]+listeFig[2];
listPosX=new Array(130,265,400);

if(total==3 || total==6 || total==9){
sonGagne.start();
tGain.text=(gain=gain+2)+"$"; tGain.setTextFormat(tGainF); tGain.setNewTextFormat(1,2,tCentF); }
else {
sonPerdu.start();
tGain.text=(gain=gain-1)+"$"; tGain.setTextFormat(tGainF); tGain.setNewTextFormat(1,2,tCentF); }

for(i=1;i<=3;i++){
with(eval("alea"+i)){ _visible=false; }
attachMovie("b"+listeFig.shift(),"b"+i,202+i);
eval("b"+i)._x=listPosX[i-1]; eval("b"+i)._y=126; }
if(gain>=10){
reJouer("Gagn!"); zz2._x=455;
tGain._x=9000; manche._x=9000; fondPoint._x=9000; }
if(gain<=0){
reJouer("Perdu!"); zz2._x=455;
tGain._x=9000; manche._x=9000; fondPoint._x=9000; }
}}

function reJouer(kelTexte){
createEmptyMovieClip("fondFin",251);
with(fondFin){
attachMovie("fond3","fond3",0); fond3._alpha=75;

createTextField("t1",2,400,170,300,300);
t1.text=kelTexte; t1.embedFonts=true; t1.selectable=false;
t1F=new TextFormat(); t1F.font ="Verdana"; t1F.size =60; t1F.color=0xFFFFFF;
t1.setTextFormat(t1F);

createTextField("t2",3,440,220,300,300);
t2.text="ReJouer?"; t2.embedFonts=true; t2.selectable=false;
t2F=new TextFormat(); t2F.font ="Verdana"; t2F.size =24; t2F.color=0x000000;
t2.setTextFormat(t2F);
}}
// Signature Roy Export
createTextField("signRoy",1075,-2,373,400,20);
signRoy.text="Photos Roy Export Company Establishment. Copyright 2004 tous droits rservs.";
signRoy.embedFonts=true; signRoy._rotation=-90; signRoy.selectable=false;
signRoyF=new TextFormat(); signRoyF.font ="Verdana"; signRoyF.size =7; signRoyF.color=0x000000;
signRoy.setTextFormat(signRoyF);




Infos Despow
189 articles
1058 commentaires


Tags :
Abstraction Flyers Logotypes As2 As3 Jeux Chaplin Cinema Cd-rom ActionScript MLB Print Tw?




Ce lecteur audio diffuse aléatoirement les chansons de Tarah who?.
Intégrer ce lecteur audio sur un site :




 
  Designed and powered by Linh Hoang