Comunidad de diseño web y desarrollo en internet online

Tengo el error 1151

Citar            
MensajeEscrito el 17 Oct 2008 05:41 pm
estoy copiando y pegando un codigo para poner unos botones a mi show pero al parecer provoca un error podrian ayudarme con elcodigo?

menu_item_group.menu_item._visible = false;
var xml:XML = new XML();
var total:Number;
var i:Number = 0;
var total:Number;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
total = nodes.length;

for (; i < total; i++)
{
menu_item_group.menu_item.duplicateMovieClip("menu_item" + i, i);
menu_item_group["menu_item" + i].over = true;
menu_item_group["menu_item" + i].item_label = nodes[i].attributes.item_label;
menu_item_group["menu_item" + i].item_no = i;
menu_item_group["menu_item" + i]._x = i * 110;
menu_item_group["menu_item" + i].flashmo_button._visible = true;
menu_item_group["menu_item" + i].over = true;
menu_item_group["menu_item" + i].flashmo_button.onRollOver = function()
{
this._parent.over = false;
};
menu_item_group["menu_item" + i].flashmo_button.onRollOut =
menu_item_group["menu_item" + i].flashmo_button.onDragOut = function ()
{
this._parent.over = true;
};
menu_item_group["menu_item" + i].flashmo_button.onRelease = function()
{
getURL( nodes[this._parent.item_no].attributes.item_url,
nodes[this._parent.item_no].attributes.item_url_target);
};
menu_item_group["menu_item" + i].onEnterFrame = function()
{
if (this.over == true)
{
this.prevFrame();
}
else
{
this.nextFrame();
}
};
}
};
xml.load("flashmo_menu_item_list.xml");
xml.ignoreWhite = true;

stop();


import fl.transitions.Tween;
import fl.transitions.easing.*;

var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();

var i:Number;
var tn:Number = 0;
var scale_factor:Number = 0.6;
var tween_duration:Number = 0.8;

var angle:Number;
var degree:Number
var total:Number;
var flashmo_xml:XML = new XML();
var folder:String = "thumbnails/";
var xml_loader:URLLoader = new URLLoader();
xml_loader.load(new URLRequest("flashmo_129_thumbnail_list.xml"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);

var thumbnail_group:MovieClip = new MovieClip();
stage.addChild(thumbnail_group);

thumbnail_group.x = tn_group.x;
var default_y:Number = thumbnail_group.y = tn_group.y;

tn_group.visible = false;
fm_previous.visible = false;
fm_next.visible = false;

tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";

function create_thumbnail(e:Event):void
{
flashmo_xml = XML(e.target.data);
total = flashmo_xml.thumbnail.length();
angle = Math.PI * 2 / total;
degree = Math.round( angle * 180 / Math.PI );

for( i = 0; i < total; i++ )
{
filename_list.push( flashmo_xml.thumbnail[i][email protected]() );
url_list.push( flashmo_xml.thumbnail[i][email protected]() );
url_target_list.push( flashmo_xml.thumbnail[i][email protected]() );
title_list.push( flashmo_xml.thumbnail[i][email protected]() );
description_list.push( flashmo_xml.thumbnail[i][email protected]() );
}
load_tn();
}

function load_tn():void
{
var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
var pic_loader:Loader = new Loader();

pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
tn++;
}

function on_loaded(e:Event):void
{
if( tn < total )
{
load_tn();
}
else
{
fm_previous.visible = true;
fm_next.visible = true;
fm_previous.addEventListener( MouseEvent.CLICK, to_previous );
fm_next.addEventListener( MouseEvent.CLICK, to_next );
stage.addEventListener(MouseEvent.MOUSE_WHEEL, on_wheel );
}

var flashmo_bm:Bitmap = new Bitmap();
var flashmo_mc:MovieClip = new MovieClip();

flashmo_bm = Bitmap(e.target.content);
flashmo_bm.x = - flashmo_bm.width * 0.5;
flashmo_bm.y = - flashmo_bm.height * 0.5;
flashmo_bm.smoothing = true;

var bg_width = flashmo_bm.width + 10;
var bg_height = flashmo_bm.height + 10;

flashmo_mc.addChild(flashmo_bm);
flashmo_mc.graphics.beginFill(0x666666);
flashmo_mc.graphics.drawRect( - bg_width * 0.51, - bg_height * 0.51, bg_width * 1.02, bg_height * 1.02 );
flashmo_mc.graphics.beginFill(0xFFFFFF);
flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
flashmo_mc.graphics.endFill();

flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
flashmo_mc.buttonMode = true;
flashmo_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_mc.scaleX = flashmo_mc.scaleY = scale_factor;

flashmo_mc.x = Math.cos(thumbnail_group.numChildren * angle) * 200;
flashmo_mc.y = Math.sin(thumbnail_group.numChildren * angle) * 200;
flashmo_mc.rotation = thumbnail_group.numChildren * degree;

thumbnail_group.addChild(flashmo_mc);
}

function tn_over(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));

thumbnail_group.addChild(mc);

new Tween(mc, "scaleX", Elastic.easeOut, mc.scaleX, 1, tween_duration, true);
new Tween(mc, "scaleY", Elastic.easeOut, mc.scaleY, 1, tween_duration, true);

tn_title.text = title_list[s_no];
tn_desc.text = description_list[s_no];
}

function tn_out(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);

new Tween(mc, "scaleX", Strong.easeOut, mc.scaleX, scale_factor, tween_duration, true);
new Tween(mc, "scaleY", Strong.easeOut, mc.scaleY, scale_factor, tween_duration, true);

tn_title.text = "";
tn_desc.text = "";
}

function tn_click(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));

navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}

function to_previous(e:MouseEvent):void
{
new Tween( thumbnail_group, "rotation", Strong.easeOut,
thumbnail_group.rotation, thumbnail_group.rotation + degree, tween_duration, true );
}

function to_next(e:MouseEvent):void
{
new Tween( thumbnail_group, "rotation", Strong.easeOut,
thumbnail_group.rotation, thumbnail_group.rotation - degree, tween_duration, true );
}

function on_wheel(e:MouseEvent):void
{
if( e.delta > 0 )
{
new Tween( thumbnail_group, "rotation", Strong.easeOut,
thumbnail_group.rotation, thumbnail_group.rotation + degree, tween_duration, true );
}
else
{
new Tween( thumbnail_group, "rotation", Strong.easeOut,
thumbnail_group.rotation, thumbnail_group.rotation - degree, tween_duration, true );
}
}
emp.addEventListener(MouseEvent.CLICK, enlaza);
co.addEventListener(MouseEvent.CLICK, enlaza);
index.addEventListener(MouseEvent.CLICK, enlaza);

function enlaza(evento:MouseEvent):void {
switch (evento.target.name) {
case 'emp':
navigateToURL(new URLRequest("empresa.html"));
break;
case 'co':
navigateToURL(new URLRequest("contacto.html"));
break;
case 'index':
navigateToURL(new URLRequest("index.html"));
break;
}
}

Por alexstorm

45 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 17 Oct 2008 07:49 pm
Bastante largo para no tener formato:

Código :

[as]
//Inserta los codigos entre tags de ActionScript
[/as]


Y postea también el error que te lanza.

Por si acaso te advierto que es un código de ActionScript 3, así que si lo pegas en un documento con AS1 o AS2 te lanzará errores.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.