funciones programacion

10
funcione s

description

 

Transcript of funciones programacion

Page 1: funciones programacion

funciones

Page 2: funciones programacion

Y vamos aplicando a ejemplo como este:

function ContarHastaDiez():void{ for (var 1=0;1<10;1++){

trace (i); }}

ContarHastaDiez

Page 3: funciones programacion

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);

Page 4: funciones programacion

ejecución

Page 5: funciones programacion

Crear gráficos en flash por medio de código

this.graphics.lineStyle(6,0x00ff99);this.graphics.moveTo(200,100);

this.graphics.lineTo(300,250)

this.graphics.lineStyle(5,0x3456ff559);

this.graphics.curveTo(100,100,30,200);

Page 6: funciones programacion

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);

Page 7: funciones programacion

Texto en flashimport 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);

Page 8: funciones programacion

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 hipervinculosimport 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:"#0000ff"var miEnlaceWeb:TextField=new TextField();

miEnlaceWeb.styleSheet=hojita;

Page 9: funciones programacion

var spritel:Sprite=new Sprite();

spritel.graphics.lineStyle(6,0xff9900);

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,pulsarsprite);sprite2.addEventListener(MouseEvent.CLICK,pulsarsprite);function pulsarsprite(Event:MouseEvent){

event.currentTarget.addChild(sprite3);}

Page 10: funciones programacion

Gracias