Comunidad de diseño web y desarrollo en internet online

Problema llamar a una función dentro de un Media Controller

Citar            
MensajeEscrito el 18 Nov 2009 11:04 pm
Que tal, estimados ojalá me puedan ayudar

Tengo un Media Controller insertado en mi fla principal que llama a un swf externo

loadMovie("flashmo_107_slider.swf", "contenedor");


este swf externo es un banner rotativo de imagenes mediante la función tween, la función está adjunta,

estoy tratando de hacer un botón externo a este swf, xq como verán ya hay unos internos que funcionan bien fm_previous y fm_previous, PERO QUIERO HACERLOS EXTERNOS

entonces pensé en algo así
on (release) {

_root.flashmo_slider.INTENTE CON VARIAS FORMAS LLAMANDO FUNCIONES ETC Y NO LLAMA A NADA

}

flashmo_slider es el nombre del simbolo que contiene el banner rotativo del swf externo


GRACIAS



Código ActionScript :

stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
flashmo_item._visible = false;

var xml_file:String = "flashmo_107_list.xml";
var folder:String = "thumbnails/";
var auto_duration:Number = 5000; // where 1 second equals 1000
var auto_play:Boolean = true;   // true = ON | false = OFF
var tween_duration:Number = 0.6;   // in seconds

var item_filename:Array = new Array();
var item_url:Array = new Array();
var item_url_target:Array = new Array();
var item_title:Array = new Array();
var item_description:Array = new Array();
var total:Number;
var i:Number;
var interval_id:Number;
var current:Number = 0;
var xml:XML = new XML();

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

   for( i = 0; i < total; i++)
   {
      item_filename[i] = nodes[i].attributes.filename;
      item_url[i] = nodes[i].attributes.url;
      item_url_target[i] = nodes[i].attributes.target;
      item_title[i] = nodes[i].attributes.title;
      item_description[i] = nodes[i].attributes.description;
   }
   create_item_list();
}
xml.load( xml_file );
xml.ignoreWhite = true;

function create_item_list():Void
{
   for( i = 0; i < total; i++)
   {
      var item = flashmo_item.duplicateMovieClip("fm_item"+i, i);
      item.fm_pic.loadMovie(folder + item_filename[i]);
      item._x = i*732;
      item.fm_title.text = item_title[i];
      item.fm_description.text = item_description[i];
      item.no = i;
      item.fm_button.onRelease = function()
      {
         getURL( item_url[this._parent.no], item_url_target[this._parent.no] );
      }
   }
   if( auto_play == true )
   {
      interval_id = setInterval(this, "change_item", auto_duration);
   }
}
function change_item(command)
{
   fm_previous.enabled = fm_next.enabled = false;
   old_number = current;
   
   if( command == "previous" )
      current--;
   else
      current++;
   
   if( current < 0 )
      current = total - 1;
   if( current >= total )
      current = 0;
      
   old_item = this["fm_item" + old_number];
   new_item = this["fm_item" + current];

   if( command == "previous" )
   {
      var fm_tween = new Tween(old_item, "_x", Strong.easeInOut, 0, 722, tween_duration, true);
      new Tween(new_item, "_x", Strong.easeInOut, -722, 0, tween_duration, true);
   }
   else
   {
      var fm_tween = new Tween(old_item, "_x", Strong.easeInOut, 0, -722, tween_duration, true);
      new Tween(new_item, "_x", Strong.easeInOut, 722, -0, tween_duration, true);
   }
   fm_tween.onMotionFinished = function()
   {
      fm_previous.enabled = fm_next.enabled = true;
   }
}
function fm_interval()
{
   if( fm_auto._currentframe == 2 )
   {
      interval_id = setInterval(this, "change_item", auto_duration);
   }
   else
   {
      clearInterval(interval_id);
   }
   fm_auto.play();
}
fm_previous.onRelease = function()
{
   change_item("previous");
}
fm_next.onRelease = function()
{
   change_item("next");
}
fm_auto.onRelease = function()
{
   this._parent.fm_interval();
}
if( auto_play == true )
   fm_auto.gotoAndStop(1);
else
   fm_auto.gotoAndStop(2);

Por narq

4 de clabLevel



 

firefox
Citar            
MensajeEscrito el 01 Dic 2009 10:21 pm
Alguien que me ayude por favor.

Necesito crear un botón pero afuera del símbolo, he intentado llamarlo con el nombre del simbolo pero no me funciona, es lo mismo que estos botones pero dando la instancia a un simbolo botón fuera del clip de película que contiene este código, pero no me anda llamando la función desde afuera el clip se llama.

ME ENTIENDEN O NO?

fm_previous.onRelease = function()
{
change_item("previous");
}
fm_next.onRelease = function()
{
change_item("next");
}

ESTOS ULTIMOS SON LOS BOTONES DENTRO DEL CLIP
EL MEDIA CONTROLER SE LLAMA contenedor

Y EL CLIP QUE CONTIENE EL CODIGO flashmo_slider

ALGO ASI SERÍA, PERO FALTARÍA LLAMAR LA FUNCIÓN O LA RUTA DENTRO DEL MEDIA CONTROLLER


on (release) {

_root.contenedor.gotoAndPlay("next");

}

Por narq

4 de clabLevel



 

firefox

 

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