funciones
Y vamos aplicando a ejemplo como
este:
function ContarHastaDiez():void{
for (var 1=0;1<10;1++){
trace (i);
}
}
ContarHastaDiez
var nombre:String="daniela";
var apellido:String="diaz";
function nombreCompleto() : String{
if(!nombre ||!apellido){
return "";}
var miNombre:String=nombre+" "+apellido;
return miNombre;
}
var usuario :String=nombreCompleto();
trace (usuario);
ejecución
this.graphics.lineStyle(6,0x00ff99);
this.graphics.moveTo(200,100);
this.graphics.lineTo(300,250)
this.graphics.lineStyle(5,0x3456ff55
9);
this.graphics.curveTo(100,100,30,2
00);
this.graphics.lineStyle(6,0x00ff99);
this.graphics.moveTo(200,100);
this.graphics.lineTo(300,250)
this.graphics.lineStyle(5,0x3456ff559);
this.graphics.curveTo(00,350,30,200);
this.graphics.drawRect(300,30,60,90);
this.graphics.drawCircle(350,260,70);
this.graphics.beginFill(0x000030);
this.graphics.drawEllipse(360,100,100,30)
this.graphics.endFill();
this.graphics.drawCircle(150,260,70);
Texto en flash
import flash.text.TextField;
var texto:TextField=new TextField();
texto.text="aqui tenemos un ejemplo de
como emplear texto con codigo en flash";
texto.x=120;
texto.y=200;
texto.width=350;
addChild(texto);
import flash.text.TextField;
var miFormato:TextFormat=new TextFormat();
miFormato.bold=true;
miFormato.font="arial";
miFormato.size=30;
miFormato.color=0x000ab;
var texto:TextField=new TextField();
texto.text="te quieroo muchop ";
texto.x=50;
texto.y=50;
texto.width=350;
texto.border=true
texto.setTextFormat(miFormato);
addChild(texto);
crear hipervinculos
import flash.text.TextField;
var miEnlaceWeb:TextField=new TextField();
miEnlaceWeb.htmlText="visita a <A
HREF='http://www.iemoraosejo.edu.co'>luis eduardo mora osejo";
miEnlaceWeb.width=260;
addChild (miEnlaceWeb)
import flash.text.StyleSheet;
var hojita:StyleSheet=new StyleSheet();
hojita.setStyle("A",{(textDecoration:"underline",color:"#0
00ff"
var miEnlaceWeb:TextField=new TextField();
miEnlaceWeb.styleSheet=hojita;
var spritel:Sprite=new
Sprite();
spritel.graphics.lineStyle(6,0x
ff9900);
spritel.graphics.drawRect(0,0,
250,250);
addChild(spritel);
spritel.y=50;
addChild(sprite2);
var sprite3:Sprite=new Sprite();
sprite3.graphics.lineStyle(2,0xfffff);
sprite3.graphics.beginFill(0xcccc00);
sprite3.graphics.drawCircle(0,0,25);
spritel.x=125;
spritel.y=125;
addChild(sprite3);
al dar clic
var sprite3:Sprite=new Sprite();
sprite3.graphics.lineStyle(2,0xfffff);
sprite3.graphics.beginFill(0xcccc00);
sprite3.graphics.drawCircle(0,0,25);
spritel.x=125;
spritel.y=125;
addChild(sprite3);
sprite1.addEventListener(MouseEvent.CLICK,pulsa
rsprite);
sprite2.addEventListener(MouseEvent.CLICK,pulsa
rsprite);
function pulsarsprite(Event:MouseEvent){
event.currentTarget.addChild(sprite3);
}
Gracias

funciones programacion