Repeat code or what?
Here's my problem, I made a gallery using an on-line tutorial and it works in treating the xml file. What I want to do is to repeat this code on a different image, but referencing a different xml - so receive different images. I tried just copy - paste it but of course it did not work.
I tried to separated variable string in which I will put the name of my xml file, then from the Gallery code, I reference just this variable. But it does not work either. It's like when the code runs once it won't run more although even its tru "spread" several images, not copied on different keyframes.
Is there an easy way to do what im triing to do?
The Gallery code:
Import fl.controls.ProgressBar;
Import fl.transitions.Tween;
Fl.transitions.easing import. *;
Import fl.transitions.TweenEvent;
columns: number var;
var my_x:Number;
var my_y:Number;
var my_thumb_width:Number;
var my_thumb_height:Number;
var my_images:XMLList;
var my_total:Number;
var container_mc:MovieClip;
var preloaders_mc:MovieClip;
var full_mc:MovieClip;
var x_counter:Number = 0;
var y_counter:Number = 0;
var my_tweens:Array = [];
var container_mc_tween:Tween;
var full_tween:Tween;
var myXMLLoader:URLLoader = new URLLoader();
myXMLLoader.load (new URLRequest (xml));
myXMLLoader.addEventListener (Event.COMPLETE, processXML);
function processXML(e:Event):void {}
var myXML:XML = new XML (e.target.data);
columns = myXML.@COLUMNS;
my_x = myXML.@XPOSITION;
my_y = myXML.@YPOSITION;
my_thumb_width = myXML.@WIDTH;
my_thumb_height = myXML.@HEIGHT;
my_images = myXML.IMAGE;
my_total = my_images.length ();
createContainer();
callThumbs();
myXMLLoader.removeEventListener (Event.COMPLETE, processXML);
myXMLLoader = null;
}
function createContainer (): void {}
container_mc = new MovieClip();
container_mc.x = my_x;
container_mc.y = my_y;
addChild (container_mc);
container_mc.addEventListener (MouseEvent.CLICK, callFull);
container_mc.addEventListener (MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener (MouseEvent.MOUSE_OUT, procedure);
container_mc.buttonMode = true;
preloaders_mc = new MovieClip();
preloaders_mc.x = container_mc.x;
preloaders_mc.y = container_mc.y;
addChild (preloaders_mc);
}
function callThumbs (): void {}
for (var i: Number = 0; i < my_total; i ++) {}
var thumb_url = my_images[i].@THUMB;
var thumb_loader = new Loader();
thumb_loader. Load (new URLRequest (thumb_url));
thumb_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, thumbLoaded);
thumb_loader. Name = i;
thumb_loader.x = (my_thumb_width + 10) * x_counter;
thumb_loader.y = (my_thumb_height + 10) * y_counter;
If (x_counter + 1 < columns) {}
x_counter ++;
} else {}
x_counter = 0;
y_counter ++;
}
var preloader_pb:ProgressBar = new ProgressBar();
preloader_pb.source = thumb_loader.contentLoaderInfo;
preloader_pb.x = thumb_loader.x;
preloader_pb.y = thumb_loader.y;
preloader_pb. Width = my_thumb_width;
preloader_pb. Height = my_thumb_height;
preloaders_mc. AddChild (preloader_pb);
preloader_pb.addEventListener (Event.COMPLETE, donePb);
}
}
function thumbLoaded(e:Event):void {}
var my_thumb:Loader = Loader (e.target.loader);
container_mc. AddChild (my_thumb);
my_tweens [Number (my_thumb. (Name)] = new Tween (Strong.easeIn, 0,1,0.5, my_thumb, "alpha", true);
my_thumb.contentLoaderInfo.removeEventListener (Event.COMPLETE, thumbLoaded);
}
function callFull(e:MouseEvent):void {}
var full_loader:Loader = new Loader();
var full_url = my_images[e.target.name].@FULL;
full_loader. Load (new URLRequest (full_url));
full_loader.contentLoaderInfo.addEventListener (Event.INIT, fullLoaded);
var full_pb:ProgressBar = new ProgressBar();
full_pb.source = full_loader.contentLoaderInfo;
full_pb.x = (stage.stageWidth - full_pb.width) / 2;
full_pb.y = (stage.stageHeight - full_pb.height) / 2;
preloaders_mc. AddChild (full_pb);
full_pb.addEventListener (Event.COMPLETE, donePb);
container_mc. RemoveEventListener (MouseEvent.CLICK, callFull);
container_mc.buttonMode = false;
container_mc. RemoveEventListener (MouseEvent.MOUSE_OVER, onOver);
container_mc. RemoveEventListener (MouseEvent.MOUSE_OUT, procedure);
container_mc_tween = new Tween (container_mc, "alpha", Strong.easeIn, 1,0.5,0.5, true);
}
function fullLoaded(e:Event):void {}
full_mc = new MovieClip();
full_mc.buttonMode = true;
addChild (full_mc);
var my_loader:Loader = Loader (e.target.loader);
full_mc. AddChild (my_loader);
full_tween = new Tween (Strong.easeIn, 0,1,0.5, my_loader, "alpha", true);
my_loader.x = (stage.stageWidth - my_loader.width) / 2;
my_loader.y = (stage.stageHeight - my_loader.height) / 2;
my_loader.addEventListener (MouseEvent.Click, removeFull);
my_loader.contentLoaderInfo.removeEventListener (Event.COMPLETE, fullLoaded);
}
function removeFull(e:MouseEvent):void {}
var my_loader:Loader = Loader (e.currentTarget);
full_tween = new Tween (Strong.easeOut, 1,0,0.5, my_loader, "alpha", true);
full_tween.addEventListener (TweenEvent.MOTION_FINISH, tweenFinished);
container_mc_tween = new Tween (container_mc, "alpha", Strong.easeOut, 0.5,1,0.5, true);
}
function donePb(e:Event):void {}
var my_pb:ProgressBar = ProgressBar (e.target);
preloaders_mc.removeChild (my_pb);
my_pb. RemoveEventListener (Event.COMPLETE, donePb);
}
function tweenFinished(e:TweenEvent):void {}
var my_loader:Loader = Loader (e.target.obj);
my_loader. Unload();
full_mc.removeChild (my_loader); / / This line was removeChid (my_loader), simply add full_mc in front of him.
removeChild (full_mc);
full_mc = null;
container_mc.addEventListener (MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener (MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener (MouseEvent.MOUSE_OUT, procedure);
var my_tween:Tween = Tween (e.target);
my_tween. RemoveEventListener (TweenEvent.MOTION_FINISH, tweenFinished);
}
function onOver(e:MouseEvent):void {}
var my_thumb:Loader = Loader (e.target);
my_thumb.Alpha = 0.5;
}
function onOut(e:MouseEvent):void {}
var my_thumb:Loader = Loader (e.target);
my_thumb.Alpha = 1;
}
Code Gallery of buttons:
G1.addEventListener (MouseEvent.CLICK, g1g);
function g1g(event:MouseEvent):void {}
removeChild (container_mc)
}
G1.addEventListener (MouseEvent.CLICK, gg1);
function gg1(event:MouseEvent):void {}
gotoAndPlay (108)
}
G2.addEventListener (MouseEvent.CLICK, gg2);
function gg2(event:MouseEvent):void {}
removeChild (container_mc)
}
G2.addEventListener (MouseEvent.CLICK, g2g);
function g2g(event:MouseEvent):void {}
gotoAndPlay (109)
}
G3.addEventListener (MouseEvent.CLICK, gg3);
function gg3(event:MouseEvent):void {}
removeChild (container_mc)
}
G3.addEventListener (MouseEvent.CLICK, g3g);
function g3g(event:MouseEvent):void {}
gotoAndPlay (110)
}
G4.addEventListener (MouseEvent.CLICK, gg4);
function gg4(event:MouseEvent):void {}
removeChild (container_mc)
}
G4.addEventListener (MouseEvent.CLICK, g4g);
function g4g(event:MouseEvent):void {}
gotoAndPlay (111)
}
G5.addEventListener (MouseEvent.CLICK, gg5);
function gg5(event:MouseEvent):void {}
removeChild (container_mc)
}
G5.addEventListener (MouseEvent.CLICK, g5g);
function g5g(event:MouseEvent):void {}
gotoAndPlay (112)
}
Now, we just need to create an interface through which we pass the XML URL for each gallery. Look for this piece of code in your gallery:
var myXMLLoader:URLLoader = new URLLoader(); myXMLLoader.load(new URLRequest(xml)); myXMLLoader.addEventListener(Event.COMPLETE, processXML);
Replace it with this:
var myXMLLoader:URLLoader; function loadGallery(xml:String):void { myXMLLoader = new URLLoader(); myXMLLoader.load(new URLRequest(xml)); myXMLLoader.addEventListener(Event.COMPLETE, processXML); }
In the main timeline to the frame with mc_gallery1, put this code:
mc_gallery1.loadGallery("http://www.mydomain.com/mygallery.xml"); // whatever url to your XML file
I think, you good to go.
Tags: Adobe Animate
Similar Questions
-
KB898461 repeatedly fails with error code 0x80070005 - what can I do about it?
KB898461 repeatedly fails with error code 0x80070005 - what can I do about it?
KB898461 repeatedly fails with error code 0x80070005 - what can I do about it?
Run the automatic fix here and try again once the update manually by downloading it from HERE
-
original title: error code http 500
whenever I play blitzs bingo on facebook, I get this error code. What can be done to fix this? It happens quite often.Hello
- This only happens with a particular Web site?
- What browser do you use?
HTTP 500 error: the website you are visiting had a server problem preventing the display of the Web page. It often occurs due to maintenance of the site, or due to a programming error on interactive websites that use scripts.
I suggest you try resetting Internet explorer and check to see if it helps:
http://support.Microsoft.com/kb/923737It will be useful.
-
I bought the laptop in 2006. The windows is genuine, but I don't have the activation code. What should I do? I installed vista and because I had no code after about 4 weeks it will stop. I'm up, but its prompting me to activate again. Help, please! This has been a good laptop and will continue to be if I can get help with activation.
Original title: old Dell laptop broke down.
Hello
You can contact Dell and ask them to send you a set of recovery disks and to reinstall the operating system.
They should do this for a small fee.
If this method has not been destroyed by the last re - install, and if you have never received a recovery disk when you bought your computer, there should be a recovery Partition on the hard drive to reinstall Vista on how you purchased your computer.
The recovery process can be started by pressing a particular combination of the key or keys at startup. (Power on / start)
Maybe it's F10, F11, Alt + F10, etc., depending on the manufacturer.
With a Dell, you press F8 at startup and follow the instructions
http://www.Dell.com/support/troubleshooting/us/en/19/KCS/KcsArticles/ArticleView?docid=266618
The methods above resettlement generally do not require allows you to provide a product key during Installation, the recovery process uses the Installation product key factory to activate automatically during the resettlement process.
See you soon.
-
Try to load software PhoneTree and I continue receiving ADODC error code. What should I do to install the software? How can ADODC error be corrected? I have Windows VISTA
Hello
Thanks for posting your question in the Microsoft Community.
From the description of the problem, you are not able to install a belkin wireless adapter. I'll be happy to help you on this question.
You did changes to the computer before the show?
Method 1: I suggest you to run the fixit from the following link:
Diagnose and solve the program installation and uninstallation problems automatically
http://support.Microsoft.com/mats/Program_Install_and_Uninstall/Method 2: I suggest you perform the clean boot and check if the problem persists.
How to perform a clean boot for a problem in Windows Vista, Windows 7 or Windows 8
http://support.Microsoft.com/kb/929135Note: Follow How to reset the computer to start as usual after a clean boot troubleshooting article KB929135 to reset the computer in normal mode.
Get back to us and let us know the State of the question, I'll be happy to help you. We, at tender Microsoft to excellence.
-
get the 80246002 code 80070645, what is it?
get the 80246002 code 80070645, what is it? and how can I fix this on my new computer. I have a Windows vista. 32 x not the x 64 bit
Hello
If you receive the error Windows Update 80246002 of updates, files required by Windows Update may be corrupted. This can often be corrected by renaming the Windows Update download folder, and then run Windows Update again.
You are trying to install updates?
Let's try the following and check:
Method 1:
Try the steps from the following link and check:
Windows Update error 80246002
http://Windows.Microsoft.com/en-in/Windows-Vista/Windows-Update-error-80246002
Method 2:
Please run the following fix - it:
The problem with Microsoft Windows Update is not working:
Method 3:
Manually download and install the update from Microsoft Download center.
http://www.Microsoft.com/downloads/en/default.aspx
Let us know if you need help on this problem or any question of Windows in the future.
-
I get the code 0x80072EE7, what I can do about it
who can help
I get the code 0x80072EE7, what I can do about it
The hotmail servers are off => https://status.live.com/detail/hotmail
-
I can't activate Windows 7, when I insert the product note key, which is an error 0xC004F063 problem code. What do I do?
Boost telephone:
Activate Windows 7 manually:
1. click on start and in the search for box type: slui.exe 4
2. press enter on your keyboard
3. Select your country.
4. Select the telephone activation option and brace yourself for a real person.
This is the Forum for Windows Update.
You will get the best help for any problem of activation in Windows 7 install, upgrade and activate Forum. the link below:
http://social.answers.Microsoft.com/forums/en-us/w7install/threads>
UTC/GMT is 23:41 Friday, January 20, 2012
-
I don't know what else to add, it's an HP computer and I've had it for 3 years. the hard drive has become corrupted and I replaced it and now windows 7 Home premium that I bought from best buy does not recognize as valid product code. What now?
Skip entering your product key Windows 7 and complete the installation.
When you reach the desktop, click Start, right-click on computer
Click on properties
Scroll down to the Windows Activation
Click the link x days before activation.
Click on the link that says: "show me other ways to activate.
Enter the product key
Click next
Select the Activation of the phone
Click Next when you enter your key page
Select your country
Click Next, call the number listed
Be sure to explain your situation to the Appeals Officer.
Provide the installation generated when ID requested by the call agent
They give a confirmation ID in return, enter it
Click next to complete the activation.
However, the requirements for the media upgrade is that you have an operating system already eligible such as Windows XP or Vista installed to use it. Since the Windows 7 end user license agreement.
15 UPDATES. To use upgrade software, you must first be licensed for the software that is eligible for the upgrade. After the upgrade, this agreement takes the place of the agreement for the software that you upgraded. After upgrade, you can no longer use the software that you upgraded.
So, if you are always denied, you will just have to reinstall Windows XP or Vista and let it do the verification of eligibility.
or
How to activate Windows 7 manually (activate by phone)
1) click Start and in the search for box type: slui.exe 4
(2) press the ENTER"" key.
(3) select your "country" in the list.
(4) choose the option "activate phone".
(5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
(6) explain your problem clearly to the support person.
http://support.Microsoft.com/kb/950929/en-us -
error code: 214750037 what does this mean and how do I? in the game adera
I was downloading DLC to adera and it downloads fine, but when it installs it said error of mapping content an unexpected error occurred during content acquisition. Please refer to the error code: 214750037 what does this mean and how do I?
I have the same problem with the second episode of the Adera. No change to my Surface either I have no antivirus running on this unit I just got this Friday.
-
I bought the DC of Adobe Acrobat pro and completed the info online, but when I use the cd with the product code key it will not take the code? What do I do then?
Thanks Anubha Goel, final I got it to work... The serial number in the physical box that you buy in the store wasn't the number for the software. It was the serial number in the cloud, very difficult to know when you see a serial number in the box with the Cd online. But thanks for the reply to my post. I'll be in offline mode after clicking on answer... Thank YOU Ana Maria
-
I download the demo version of Lightroom CC for Mac and it bugs with DW021 error code. What should I do?
Hello
Please visit:-Error 21 or DW021 when installing Photoshop CC 2015
or
-
I am trying to download Illustrator and I get an error code (-55) what can I do?
I am trying to download Illustrator and I get an error code (-55) what can I do?
-
in trying to download the creative cloud, he says I have an error... code 50 what I can do?
Kateyn, please follow the link below:
Error: "unable to install". Creative cloud office
Please let us know if that helps.
Atul_Saini
-
I keep for error Code 1 what updated office creative cloud
I keep for error Code 1 what updated office creative cloud
Maybe you are looking for
-
Equium A100-063 - keyboard is not recognized
Hi all I have a Toshiba Equium A100-063 (PSAAQE-00G006IT).The keyboard does not work, the usb keyboard does not work even in the bios.I disassembled the PC and unplugged the keyboard but does not work (even in bios).I formatted the PC and even the on
-
IPod nano keeps talking. I handed out the voice and is still talking
My nano keeps announcing songs and options. I have disabled the voice during the option and the voice of advice in general settings but still keep talking all the time.
-
Tecra S1: dead graphics card - need new motherboard
I encountered a problem with my Tecra S1, the lcd screen does not light and it gives a system of sound signals.After looking on the net, I concluded that the problem is with the graphics card which is integrated into the motherboard, but I can't find
-
my computer keeps rite time. any suggestion?
-
Windows Update will always on a blank page
Original title : No matter how I try to load my windows update page page still fails to load even though it says that I have updates available. Help The page is empty and said don't load, I tried the download fixit from microsoft but that no longer w