Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/04/2010, 01:24
mixboy
 
Fecha de Ingreso: mayo-2008
Mensajes: 3
Antigüedad: 16 años, 6 meses
Puntos: 0
Respuesta: problema combinado de php, xml as2 y as3

Sigo viendo. y analizando..
y creo tener la solucion
en la galeria encontre esto:


_global.SVStageWidth = 640;
_global.SVStageHeight = 420;

//Set button actions
mcGal1.onRelease = function(){
loadGallery("php/carpetes.php");
}

mcGal2.onRelease = function(){
loadGallery("gallery2.xml");
}

function loadGallery(galName){
_root.xmlDataPath = galName;
mcLoader.loadMovie("viewer.swf");
}

//load first gallery
loadGallery("php/gallery2.php");

lo cual, por logica debo meterlo en el codigo que genera el menu:

import flash.events.Event;
import flash.display.MovieClip;
import flash.events.EventDispatcher;
import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.easing.Strong;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import as3.xmlLoad;

var menuno,submenuno:int;

var i:uint;//menu component
var homepage:String;//scrollbar component

var myMenuXML:xmlLoad=new xmlLoad("xml/menu.php");//menu component

var subMenuT1:Tween;//menu component
var subMenuT2:Tween;//menu component
var MenuT1:Tween;//menu component

menuf();

function menuf() {
menuno=0; //selected menu id
submenuno=0; //selected submenu id
myMenuXML.addEventListener("loaded", myMenuXMLLoaded);
myMenu_mc.myMenu.addEventListener("mouseDown", myMenuF);//when pressed to menu
myMenu_mc.mySubMenu.addEventListener("mouseDown", mySubMenuF);
}

function myMenuXMLLoaded(event:Event):void {

event.target.removeEventListener("loaded", myMenuXMLLoaded);

myMenuRefresh(0,int(menuno));//show menu and select button(id:0)
mySubMenuRefresh(int(menuno),int(submenuno));//show sub menu and no selected button

}

function myMenuRefresh(myMenuNo:Number, selectedId:Number) {

myMenu_mc.myMenu.start();//start menu component
myMenu_mc.myMenu.selectedId=selectedId;//set selected button
myMenu_mc.myMenu.menuNo=myMenuNo;
switch (myMenuNo) {
case 0 :
if (myMenuXML.xml.menu[int(menuno)].@link!=undefined) {
homepage=myMenuXML.xml.menu[int(menuno)].@link;
} else if (myMenuXML.xml.menu[int(menuno)].submenu.menu[int(submenuno)].@link != undefined) {
homepage=myMenuXML.xml.menu[int(menuno)].submenu.menu[int(submenuno)].@link;
}
for (i=0; i<=myMenuXML.xml.menu.length()-1; i++) {
myMenu_mc.myMenu.addNew(myMenuXML.xml.menu[i].@name);//Add new name to menu
}

break;
default :
trace(".");
}
}


function myMenuF(evt:Event):void {
if (evt.type=="mouseDown") {
if (evt.target.parent.btnNum!=null) {
if (myMenu_mc.myMenu.myOldButon!=evt.target.parent.bt nNum) {
myMenu_mc.myMenu.changeBtn(evt.target.parent.btnNu m);//change pressed button
if (myMenuXML.xml.menu[evt.target.parent.btnNum].@link!=undefined) {
changePage(myMenuXML.xml.menu[evt.target.parent.btnNum].@link);
}
//set submenu x
subMenuT1=new Tween(myMenu_mc.mySubMenu,"x",Strong.easeOut,myMen u_mc.mySubMenu.x,int(myMenu_mc.myMenu.x+evt.target .parent.x),7,false);
subMenuT2=new Tween(myMenu_mc.mySubMenu,"alpha",Strong.easeIn,0, 1,5,false);
//myMenu_mc.mySubMenu.x = myMenu_mc.myMenu.x + evt.target.parent.x;
mySubMenuRefresh(evt.target.parent.btnNum,-1);//show submenu
//trace("aç");
}
}
}
}

function mySubMenuRefresh(mySubMenuNo:Number, selectedId:Number) {

myMenu_mc.mySubMenu.start();
myMenu_mc.mySubMenu.selectBtn(2);
myMenu_mc.mySubMenu.selectedId=selectedId;
myMenu_mc.mySubMenu.mySubMenuNo=mySubMenuNo;
if (myMenuXML.xml.menu[mySubMenuNo].submenu.menu.length()==0) {
MenuT1=new Tween(myMenu_mc.myMenu,"y",Strong.easeOut,myMenu_m c.myMenu.y,10,7,false);
} else {
MenuT1=new Tween(myMenu_mc.myMenu,"y",Strong.easeOut,myMenu_m c.myMenu.y,0,7,false);
}
for (i=0; i<=myMenuXML.xml.menu[mySubMenuNo].submenu.menu.length()-1; i++) {
myMenu_mc.mySubMenu.addNew(myMenuXML.xml.menu[mySubMenuNo].submenu.menu[i].@name);//Add new name to menu
}
}

function mySubMenuF(evt:Event):void {
if (evt.type=="mouseDown") {
if (evt.target.parent.btnNum!=null) {
if (myMenu_mc.mySubMenu.myOldButon!=evt.target.parent .btnNum) {
myMenu_mc.mySubMenu.changeBtn(evt.target.parent.bt nNum);//change pressed button
if (myMenuXML.xml.menu[myMenu_mc.mySubMenu.mySubMenuNo].submenu.menu[evt.target.parent.btnNum].@link!=undefined) {
changePage(myMenuXML.xml.menu[myMenu_mc.mySubMenu.mySubMenuNo].submenu.menu[evt.target.parent.btnNum].@link);
}
}
}
}
}

function changePage(fileName:String) {
//trace(fileName.substr(0,7));
if (fileName.substr(0,7)=="http://") {
var url:String=fileName;
var request:URLRequest=new URLRequest(url);
navigateToURL(request, "_self");
} else {
mySelectedText.text=fileName;
}
}

_______
Lo que no se es en donde... :S
Alguien que me ayude please.. que me tiene trancado esto jeje