hi
I have trouble with my animatnion. I have panorama 360 and xml with photos. I want to connect panorama where are buttons which show after click the photos from xml, but I have some troubles with code... When i try to compile my flash I have some errors in output;/ in zips is my fla and xml with photos.
Code:
http://www.sendspace.pl/file/546b9a824beb2e20a36845f
sorry for my english
this is my code
Code:
///pamorama
function mysz(e:Event):void
{
pano_mc.x += (-(mouseX)+260)/10;
if(pano_mc.x <= -1715 ){
pano_mc.x = 0;}
else if(pano_mc.x >= 1716){
pano_mc.x = 0;
}
///begin code with loading photos
var ladujDane:URLLoader = new URLLoader();
var adresDane:URLRequest=new URLRequest("baza.xml");
ladujDane.load(adresDane);
var dane:XML;
var adresObraz:URLRequest;
var ladujObraz:Loader = new Loader();
ladujDane.addEventListener(Event.COMPLETE, pokazDane);
function pokazDane(zarzenie:Event):void {
dane=new XML(ladujDane.data);
zdjecia();
}
var foto:Array = new Array();
var przyciski:Array=[pano_mc.p1_btn,pano_mc.p2_btn,pano_mc.p3_btn,pano_mc.p4_btn];
var liczbaZdjec:Number=4;
var dodaj:Number=0;
var i:Number=0;
function zdjecia():void {
for (var i:int = 0; i < liczbaZdjec; i++) {
dodaj++;
foto.push(dane.baneropis[].@zdjecie);
przyciski[].dodaj=foto[];
przyciski[].addEventListener(MouseEvent.CLICK, zdj);
}
}
function zdj(myszka:MouseEvent):void {
var adresFoto:String=myszka.target.dodaj;
adresObraz=new URLRequest(adresFoto);
ladujObraz.load(adresObraz);
}
ladujObraz.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, ladowanie);
function ladowanie(zdarzenie:ProgressEvent):void {
}
ladujObraz.contentLoaderInfo.addEventListener(Event.COMPLETE, zaladowano);
function zaladowano(zdarzenie:Event):void {
addChild(ladujObraz);
}
////end code with loadinx xml photos
}
pano_mc.addEventListener(MouseEvent.MOUSE_OVER, ruchAnimacja);
function ruchAnimacja(e:Event):void
{
pano_mc.addEventListener(Event.ENTER_FRAME, mysz);
}
pano_mc.addEventListener(MouseEvent.MOUSE_OUT, stopAnimacja);
function stopAnimacja(e:Event):void
{
pano_mc.removeEventListener(Event.ENTER_FRAME,mysz);
}
///end code panorama
panorama with buttons appear but I have errors in output
Code:
eferenceError: Error #1056: Can't create features dodaj w flash.display.SimpleButton.
at MethodInfo-2()
at MethodInfo-1()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()