Comunidad de diseño web y desarrollo en internet online

Problemas con FLEX+FLASH+ActionScript

Citar            
MensajeEscrito el 29 Oct 2008 02:34 pm
Hola, estoy teniedo problemas con Flex+Flash+Actionscript.

El problema es el siguiente:

Tengo una fichero Flash el cual le tengo embebido en Flex. Dicho fichero flash tiene varias zona activas donde desde Flex le envio al fichero Flash texto y varios tooltips. El problema viene cuando quiero añadir un nuevo tooltip al fichero Flash, no me lo coje. ¿A que es debido esto?

Para mas aclaracion os pongo el codigo Flash, FLex y ActionScript


Codigo Flash:

inicio.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind","elementoPulsado","0");
}

fin.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind","elementoPulsado","7");
}

paso1.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "1" );
}

paso2.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "3" );
}

paso3.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "5" );
}

hito1.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "2" );
}

hito2.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "4" );
}

hito3.onPress = function()
{
var sendLC:LocalConnection = new LocalConnection();
sendLC.send("conexionMind", "elementoPulsado", "6" );
}

// Para avisar a Flex y que muestre el bocadillo
titulo.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipTitulo,textoTitulo);
}

subtitulo.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipSubtitulo,textoSubtitulo);
}

inicio.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipInicio);
}

fin.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipFin);
}

hito1.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipHitos[0],textoHitos[0]);
}

hito2.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipHitos[1],textoHitos[1]);
}

hito3.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipHitos[2],textoHitos[2]);
}

paso1.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTipDoble",toolTipPasos[0],textoPasos[0],toolTipSubPasos[0],textoPasos[0]);
}

paso2.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTipDoble",toolTipPasos[1],textoPasos[1],toolTipSubPasos[1],textoPasos[1]);
}

paso3.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTipDoble",toolTipPasos[2],textoPasos[2],toolTipSubPasos[2],textoPasos[2]);
}

proceso1.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipSoporte);
}

proceso2.onRollOver = function ()
{
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","mostrarToolTip",toolTipSoporte);
}

// Para avisar a Flex y que quite el bocadillo
titulo.onRollOut = quitarToolTip;
subtitulo.onRollOut = quitarToolTip;

inicio.onRollOut = quitarToolTip;
fin.onRollOut = quitarToolTip;

proceso1.onRollOut = quitarToolTip;
proceso2.onRollOut = quitarToolTip;





El codigo Flex es el siguiente:

private function iniciarConexion () : void
{
lc = new LocalConnection();
lc.client = this;
lc.connect("conexionMind");
}

public function flashCargado() : void
{
flashLocalCargado=true;

lcFlex = new LocalConnection();

var descripcionPieza : String = model.textos.mind.descripcionMind;

var prueba : Array = new Array();

var textoTitulo : String = model.textos.mind.titulo;
var textoSubtitulo : String = model.textos.mind.subTitulo;

var textoPasos : Array = new Array();
var pasoPrimero : String = model.textos.mind.paso1;
var pasoSegundo : String = model.textos.mind.paso2;
var pasoTercero : String = model.textos.mind.paso3;
textoPasos[0] = pasoPrimero;
textoPasos[1] = pasoSegundo;
textoPasos[2] = pasoTercero;

var textoHitos : Array = new Array();
var hitoPrimero : String = model.textos.mind.hito1;
var hitoSegundo : String = model.textos.mind.hito2;
var hitoTercero : String = model.textos.mind.hito3;
textoHitos[0] = hitoPrimero;
textoHitos[1] = hitoSegundo;
textoHitos[2] = hitoTercero;

var toolTipTitulo : String = model.textos.mind.toolTipTitulo;
var toolTipSubtitulo : String = model.textos.mind.toolTipSubtitulo;

var toolTipPasos : Array = new Array();
var toolTipPasoPrimero : String = model.textos.mind.toolTipPaso1;
var toolTipPasoSegundo : String = model.textos.mind.toolTipPaso2;
var toolTipPasoTercero : String = model.textos.mind.toolTipPaso3;
toolTipPasos[0] = toolTipPasoPrimero;
toolTipPasos[1] = toolTipPasoSegundo;
toolTipPasos[2] = toolTipPasoTercero;

var toolTipSubPasos : Array = new Array();
var toolTipSubPasoPrimero : String = model.textos.mind.toolTipSubpaso1;
var toolTipSubPasoSegundo : String = model.textos.mind.toolTipSubpaso2;
var toolTipSubPasoTercero : String = model.textos.mind.toolTipSubpaso3;
toolTipSubPasos[0] = toolTipSubPasoPrimero;
toolTipSubPasos[1] = toolTipSubPasoSegundo;
toolTipSubPasos[2] = toolTipSubPasoTercero;

var toolTipHitos : Array = new Array();
var toolTipHitoPrimero : String = model.textos.mind.toolTipHito1;
var toolTipHitoSegundo : String = model.textos.mind.toolTipHito2;
var toolTipHitoTercero : String = model.textos.mind.toolTipHito3;
toolTipHitos[0] = toolTipHitoPrimero;
toolTipHitos[1] = toolTipHitoSegundo;
toolTipHitos[2] = toolTipHitoTercero;

var toolTipInicio : String = model.textos.mind.inicio;
var toolTipFin : String = model.textos.mind.fin;


var textosLaterales : Array = new Array();
var textoIzquierdo : String = model.textos.mind.pasoIzquierdo;
var textoDerecho : String = model.textos.mind.pasoDerecho;
var textoSuperior : String = model.textos.mind.pasoSuperior;
var textoInferior : String = model.textos.mind.pasoInferior;
textosLaterales[0] = textoIzquierdo;
textosLaterales[1] = textoDerecho;
textosLaterales[2] = textoSuperior;
textosLaterales[3] = textoInferior;

//var toolTipSoporte : String = model.textos.mind.toolTipSoporte;

try
{

lcFlex.send("conexionMindFlex", "recibirTextos" , descripcionPieza, textoTitulo, textoSubtitulo, textoPasos, textoHitos, toolTipTitulo, toolTipSubtitulo, toolTipInicio, toolTipFin, toolTipPasos, toolTipSubPasos, toolTipHitos, textosLaterales);
}
catch (e:*){}
}




El fihcero de ActionScript es el siguiente:



var descripcionPieza : String;
var textoTitulo : String;
var textoSubtitulo : String;
var textoPasos : Array = new Array();
var textoHitos : Array = new Array();
var toolTipTitulo : String;
var toolTipSubtitulo : String;
var toolTipPasos : Array = new Array();
var toolTipSubPasos : Array = new Array();
var toolTipHitos : Array = new Array();
var toolTipInicio : String;
var toolTipFin : String;
var toolTipSoporte : String;

// Para la comunicación de Flex a Flash
var lc:LocalConnection = new LocalConnection();
lc.allowDomain("*");
lc.connect("conexionMindFlex");

// Para avisar a Flex que mande los textos
var l:LocalConnection = new LocalConnection();
l.send("conexionMind","flashCargado");


lc.recibirTextos = function (descripcion : String, titulo : String, subtitulo : String, pasos : Array, hitos: Array, ttTitulo : String, ttSubtitulo : String, ttInicio : String, ttFin : String, ttPasos : Array, ttSubpasos : Array, ttHitos : Array, textoslaterales : Array)
{
// Asigno los textos a variables locales de Flash
descripcionPieza = descripcion;
textoTitulo = titulo;
textoSubtitulo = subtitulo;
textoPasos = pasos;
textoHitos = hitos;
toolTipTitulo = ttTitulo;
toolTipSubtitulo = ttSubtitulo;
toolTipPasos = ttPasos;
toolTipSubPasos = ttSubpasos;
toolTipHitos = ttHitos;
toolTipInicio = ttInicio;
toolTipFin = ttFin;

Por sanetes

46 de clabLevel



 

msie7
Citar            
MensajeEscrito el 29 Oct 2008 02:51 pm
Vaya pedazo de ladrillo de código
No seré yo quien lo lea, pero ayuda a que Matrix lo entienda y dale formato

Jorge

Tip: aumentarás siempre tu chance de obtener respuesta formulando alguna hipótesis sobre el problema y solo poniendo el code indispensable

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

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