Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/06/2010, 07:37
catatonica
 
Fecha de Ingreso: mayo-2009
Mensajes: 71
Antigüedad: 14 años
Puntos: 0
Pregunta Respuesta: caracteres especiales en actionscript 3

Los nombres de los botones están en un fotograma asi:

flashmo_button.visible = false;
var menu_label:Array = new Array("Nosotros",
"Diseño Web",
"Diseño Grafico",
"Posicionamiento",
"Portfolio",
"Contactos");
var total:Number = menu_label.length;
var spacing:Number = 10;
var i:Number = 0;
var page:Number;
var main_menu:MovieClip = new MovieClip();
stage.addChild(main_menu);

for( i = 0; i < total; i++ )
{
var btn = new button();
btn.name = "btn" + i;
btn.x = flashmo_button.x;
btn.y = flashmo_button.y + (flashmo_button.height + spacing) * i;
btn.icons.gotoAndStop( i + 1 );
btn.item_no = i;
btn.addEventListener( Event.ENTER_FRAME, btn_enter );

var each_substring:Array = menu_label[i].split("|");
btn.item_label.fm_label.text = each_substring[0];
btn.item_url = each_substring[1];
main_menu.addChild(btn);
}

function btn_over(e:MouseEvent):void
{
e.target.over = true;
}

function btn_out(e:MouseEvent):void
{
e.target.over = false;
}

function btn_click(e:MouseEvent):void
{
var mc = e.target.parent;
if( mc.item_url != undefined )
navigateToURL( new URLRequest( mc.item_url ), "_parent" );
else
change_page(mc.item_no);
}

function btn_enter(e:Event):void
{
var mc = e.target;
if( mc.over == true )
mc.nextFrame();
else
mc.prevFrame();
}

function change_page(no:Number):void
{
for( var i:Number = 0; i < main_menu.numChildren; i++ )
{
var mc = MovieClip( main_menu.getChildAt(i) );
mc.over = false;
mc.click_area.visible = true;
mc.addEventListener( MouseEvent.ROLL_OVER, btn_over );
mc.addEventListener( MouseEvent.ROLL_OUT, btn_out );
mc.addEventListener( MouseEvent.CLICK, btn_click );
}
var mc_selected = MovieClip( main_menu.getChildAt(no) );
mc_selected.over = true;
mc_selected.click_area.visible = false;
mc_selected.removeEventListener( MouseEvent.ROLL_OVER, btn_over );
mc_selected.removeEventListener( MouseEvent.ROLL_OUT, btn_out );
mc_selected.removeEventListener( MouseEvent.CLICK, btn_click );

page = no + 1;
play();
}
change_page(0); // default page on load

designed_by.addEventListener( MouseEvent.CLICK, credit_link );

function credit_link(e:MouseEvent):void
{
navigateToURL( new URLRequest( "http://www.o2studio.com.ar" ), "_parent" );
}

Saludos.