Dynamic Photo Gallery in Flash using AS3.0 and XML, but it doesn't work and missed up my app.
Hi,
I am creating an iPad app using AS3. The app contains three sections.
One of those sections (chocolate sources)contains Dynamic Photo Gallery using XML. The photos, thumbnails, and text in this section are loaded from XML.
I faced may issue when I tried to run this app:
The gallery photos didn't show up
The thumbnails (buttons to navigate the photo gallery) didn't show up at all. (The thumbnails should show up under the photo gallery box.)
The text doesn't show up (the text should be in every photo as describtion)
I want to include Swipe in the photo gallery, how can I do that?
When I click on "Chocolate Sources" button, the photo gallery appears in every section, here are print screens describe what I mean:
The photo gallery covers the home screen too.
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<sources>
<section>
<details>
Cocoa tree exists in the tropics area, such as Central and South America.
</details>
<image>
<url>coca1.jpg</url>
</image>
</section>
<section>
<details>
Cocoa is supplied in many countries such as Indonesia, Ghana, Brazil, Ecuador and Cameroon.
</details>
<image>
<url>coca2.jpg</url>
</image>
</section>
<section>
<details>
Dark chocolate helps to relax and reduce the stress and blood pressure because it has antioxidants elements, which helps in vasodilatory process.
</details>
<image>
<url>coca3.jpg</url>
</image>
</section>
<section>
<details>
Chocolate provides energy and hyperactive sometimes because it contains high level of caffeine and sugar.
</details>
<image>
<url>coca4.jpg</url>
</image>
</section>
<section>
<details>
Chocolate could be mixed with many different flavors, such as mint, strawberry, orange, banana, vanilla, hazelnut, almond, coconut, and etc.
</details>
<image>
<url>coca5.jpg</url>
</image>
</section>
<section>
<details>
Chocolate is expressing of well hospitality and good time due to its lovely taste.
</details>
<image>
<url>coca6.jpg</url>
</image>
</section>
</sources>
And here is my Action Script for "Chocolate Sources" section:
stop();
function Choco1(evt:MouseEvent): void {
gotoAndStop('16');
choco_btn.addEventListener(MouseEvent.CLICK,Choco1);
function Souc1 (evt:MouseEvent): void {
gotoAndStop ('31');
souc_btn.addEventListener(MouseEvent.CLICK,Souc1);
function ShopIn1 (evt:MouseEvent):void {
gotoAndStop('46');
shops_btn.addEventListener(MouseEvent.CLICK,ShopIn1);
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.motion.MotionEvent;
import flash.events.MouseEvent;
import flash.sampler.NewObjectSample;
import flash.text.TextFormat;
var xmlLoader: URLLoader = new URLLoader (new URLRequest("sources.xml"));
xmlLoader.addEventListener(Event.COMPLETE, finishedXmlLoader);
var xmlFile:XML;
var xextend:int = 10;
var gal:galary = new galary ();
gal.x = 85;
gal.y = 165;
addChild(gal);
var txfe: TextField = new TextField ();
txfe.x = 25;
txfe.y = 45;
var tformat:TextFormat = new TextFormat ();
tformat.bold = true;
tformat.color = 0xFFFFFF;
tformat.size = "18";
tformat.font = "Arial";
txfe.defaultTextFormat = tformat;
addChild(txfe);
function finishedXmlLoader (e:Event): void{
xmlFile = new XML (xmlLoader.data);
var leng:int = xmlFile.image.length();
txfe.text = xmlFile.image.details[0];
for (var i:int = 0;i<leng;i++){
var b:thumbs = new thumbs ();
b.x = xextend;
b.y = 480;
b.buttonMode = true;
b.details = (i+1).toString();
addChild(b);
b.addEventListener(MouseEvent.MOUSE_OVER, theMosover);
b.addEventListener(MouseEvent.MOUSE_OUT, theMosout);
b.addEventListener(MouseEvent.CLICK, onMosClick);
var bloader:Loader = new Loader();
bloader.load(new URLRequest("thumbs/" + (i+1) + ".jpg"));
b.addChild(bloader);
xextend += b.width + 50;
var loader:Loader = new Loader ();
loader.load(new URLRequest ("pictures/coca1.jpg"));
gal.addChild(loader);
function theMosover(m:MotionEvent):void{
m.currentTarget.alpha = 0.5;
function theMosout (m:MouseEvent):void{
m.currentTarget.alpha = 1.0;
function onMosClick(m:MouseEvent):void{
var loader:Loader = new Loader();
loader.load(new URLRequest("pictures/" + m.currentTarget.details + ".jpg"));
gal.addChild(loader);
txfe.text = xmlFile.image.details[int(m.currentTarget.details) -1];
I need an urgent help to fix the errors and make this section work well.
thanks.
try:
txfe.text = xmlFile.section[int(m.currentTarget.details) -1].details;
instead of
txfe.text = xmlFile.image.[int(m.currentTarget.details) -1];
and add your thumbs to gal, not the stage. when you're done with the gallery, remove gal.
Similar Messages
-
My Ipad 3erd Gen... si dsiplayin a message:
"Not Enough Storage: this ipad cannot be backed up because there is noit enough iCloud storage available. you can manage yor setorage in settings"
Ihave tride pushing either Close or Settings and it doesnt do anything, i cant shut down or push a command in setteings mode, the message appears to be frozen in the center of the screen!
HELP!!!!!Try a reset:
Hold the Sleep and Home button down for about 10 second until you see the Apple logo. -
At the moment I can use my apple Id on my iPod touch to connect to iCloud and IMessage and FaceTime but it doesn't work on App Store & iTunes just on iPod Face to an error: can not connect to iTunes Store. (Setting... itunes & app store)What's wrong? My apple Id is working on my MacBook Pro as well. And it was working on this iPod before resetting . Just after resetting I can not connect to App Store & iTunes and I can not instal any app even free apps
Try
Can't connect to the iTunes Store -
When I try to eject my ipod after sync I get the following message:The iPod cannot be restored because it contains files that are in use by another application.". I tried to restore but it doesn't work and I get the same message
Go to your computer's System Tray and try ejecting. If you can't eject, there is an application that is trying to access your iPod.
Go to http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx and download ProcessExplorer.
Go to http://support.microsoft.com/kb/555665 and follow the instructions under Resolution.
Note that this is a good, general process any time you can't access any file.
In my case an update to RealPlayer installed a program called RecordingManager that was accessing my iPod. -
i can`t use apple store. my apple id needs my paswoord, to set the security questions, after I introduce the paswoord it askes for the paswoord again and again! it doesn`t work, and the paswoord is the right one. What can i do?
I have figured out already. Firstly please try:
1) Installing iBooks on your iPhone via iTunes on PC/MAC
2) Adjust the time of your iPhone to 6 months ahead (e.g. 2013 May)
3) Close all apps currently running, clear Safari cache and history, sign out of Apple ID (Settings>iTunes & App Stores), reboot your device
4) Open iBooks on your iPhone, download any 1 book
5) System should prompt you to enter 3 security questions
6) Enter your answer and click "Done" at bottom right part of your input keyboard (Do not press upper right button)
7) Done!
I cannot imagine the system has gone so stupid. Apple, please retify the problem ASAP. -
just got new hard drive installed from apple and my old password doesn't work and it won't let me change it.cant install anything ,pls help,thx
Camera works. Now gotta find out about this mic thing
-
I try to update ios to 6.1 but it doesn't work and now iphone gone to factory mode from initial stage and upon when am connecting to itune its not getting thru, kindly advice
From the Firefox help files;<BR><BR>
Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches. -
Updated to Flash 10 for OSX10.4 but it doesn't work on some websites
I'm using Firefox but it happens in Safari as well. Some websites are OK. But others with flash appear blank or on myspace the music says i need to update my flash player. I have the newest flash player. I went to the check if flash installed correctly and i see the animation and all is fine. But some websites with flash don't seem to work.
Is there an easy fix somehow? Why do some work and others left blank?there must be a solution. come on guys... i uninstalled using the adobe uninstaller and reinstalled but still no good. works for some websites, doesn't work for others
-
Within music Library can anyone please explain why after I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums? How can I fix this? I have tried to manually correct by 'drag and drop' individual tracks but that doesn't work. My music library includes a number of repeat album artwork images simply because not all tracks are being listed under the one album making my library more difficult to use than it should. Any advise would be appreciated.
See Grouping tracks into albums.
tt2 -
I just upgraded the software on my iPhone 4s. Now the touchscreen doesn't work and on the screen is the itunes logo, an arrow and a plug. I have powered it off and on and nothing changes
The iTunes icon and cable means that it's gone into recovery mode - you will need to connect the phone to your computer's iTunes and you should be able to use that to reset the phone, and you can then restore/resync your content to it
-
I transferred my files from a G4 to a new macbook pro, but I can't access my old songs in itunes. I clicked on library in itunes and get the mac page to access mp3 and acc files but it doesn't work. Any suggestions?
They maybe corrupt, try transferring again from the g4. If iTunes is giving you an error then you need to authorize your computer with the same iTunes account as previously. Also, you could try exporting your iTunes library via iTunes on the g4.
-
I have tried to open Firefox, but it just sits there and doesn't load. I have tried to uninstall and reinstall but that works for a few hours and then it goes back to not loading. I don't know what else to do to get it too load.
Right-click on your Windows Taskbar and select Start Task Manager. Look in Task Manager for processes running that are Firefox-related, such as Firefox.exe or plugin-container.exe. If you see either of those, right-click each of them and select "End process". Then try again to start Firefox in [[Safe Mode]]. <br /><br />
*If Firefox will start in Safe Mode, select the option you are presented with to disable your add-ons and plug-ins and restart Firefox normally. You likely have a plug-in, add-on, or a combination of two or more that is causing the problem. Because Firefox allows users to customize endlessly, sometimes there can be conflicts between customized items. From the Firefox menu bar, go to<br /><br />Tools -> Add-ons<br /><br />then re-enable them one by one, restarting Firefox after each and testing after each one to see which one or combination of two or more is causing the problem. <br /><br />
*If Firefox will not start in Safe Mode, make sure you again check Task Manager and end any running instances, then uninstall Firefox and download a fresh copy from mozilla.org/firefox using another browser temporarily. Re-install Firefox (see: [[Installing Firefox on Windows]] for more help ) and try running Firefox again.
Please report back your progress. -
My Wifi connection goes off if computer dies or shuts off, I can only make it work if I go into safe mode and reboot, it was just that, but now my keyboard doesn't light up like it's supposed to in low or no light and in system preferences it's like it doesn't exist. Also, the sound doesn't work, I can't turn it up or down, it shows the sound icon grayed out and the anti symbol when I push F11 and F12, also it's like it doesn't exist in system preferences either. I have never had any problems with my MB Pro, I purchased in Feb. 2010. , but I upgraded to Lion last month, I haven't been using my laptop as much since I had an Ipad I given to me, so I think that's why I didn't notice these issues right away. What do I do? HELP!! Do I take it to Apple? I don't have the Apple care warranty, so will it be expensive for them to fix? Can I get my money back for Lion if I restore to Snow Leopard?
Take it to an Apple store or AASP. How much it will cost will depend on their determination of the problems. To bad you didn't purchase extended AppleCare. No you don't get your money back for purchasing Lion.
-
I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
Thank you for your help.Hi Ssheoran,
Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
Best Regards,
Roel F.
Applications Engineer
National Instruments -
and now when you open it it clicks in the back left corner. And before now the sound would be working fine and then i would put the laptop in sleep mode and when i would try to use it later the sound wouldnt work and i would have to restart it.
Take it to an Apple store to be checked out and an estimate on the cost of replacing the parts that broke from the fall off the bed.
Maybe you are looking for
-
Adode Reader will not Update - Hangs on HKEY_Local_Machine Register Issue
Hi All, Can you please help. I run a Vista 32 bit PC, Adobe updater has treid to undate the reader from Ver 8 to 9, it downloads new files successfully, activates the installer, almost completes then stops with an error which says "HKEY_LOCAL_MACHINE
-
Problems with itunes syncing!!!!
Hi All, I have just updated my music library adding album art to all artists, yet when i sync with ipad, it doesnt update. Also I synced ipad so i should of only had one album on ipad, yet even though it only showed the one album on itunes, all the o
-
Hey...help me out
hey i am running the following code if(o==b2) fbalance.setVisible(true); fwelcome.setVisible(false); if(o==b8) String stracc=tacc.getText(); String strid=tid.getText(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getCo
-
I recently bought an iBook 500 and find that the CD tray seems to be sticking. When I eject a CD, the tray only opens up about 1/16th of an inch. This isn't normal is it? I can pull it out to get the CD out. When I insert a CD, it won't go in by itse
-
Print from iPad over Bluetooth Printer there is a way?
I want to develope an App that will detect the Bluetooth Printer (NearBy) and then will print it.