Simple App - Huge Lag. Please Help.

So I have built a simple app that has 40 frames in the timeline. On each of those frames, I have an 2 images (PNG format) at 320x480 that come in at about 15kb each. I also have a block of text and 3 buttons. One button calls to an event that sets the visibility of the top image to 0, revealing the image underneath. Another click of that button sets the image visibility back to 1. The other 2 buttons control clicking back and forth between frames (previous and next buttons). Altogether I have 100 PNG image files in my app. I have imported the images into the library and they are physically in the timeline as opposed to being pulled in via ActionScript. The ActionScript for the buttons is done once and stretches across all 40 frames - it is:
btnMagnify.addEventListener(MouseEvent.CLICK, onClickMag);
btnPrev.addEventListener(MouseEvent.CLICK, onClickPrev);
btnNext.addEventListener(MouseEvent.CLICK, onClickNext);
function onClickMag(event:MouseEvent):void {
    if(myZoom == 0){
        imagefull.visible = false;
        myZoom = 1;
    } else {
        imagefull.visible = true;
        myZoom = 0;
function onClickPrev(event:MouseEvent):void {
    var myNum = currentLabel.split("-");
    gotoAndStop("pg-" + (int(myNum[1]) - 1));
function onClickNext(event:MouseEvent):void {
    var myNum = currentLabel.split("-");
    gotoAndStop("pg-" + (int(myNum[1]) + 1));
My problem is that when I export this to my iPhone, it takes about 4 seconds when I click on one of those buttons before it reacts and does what I want. If I cut down the number of frames (and, thus, images used) it increases the speed at which it performs. Should I be loading these images into the movie in a different manner so performace can be optimized on the iPhone? I've been working with Flash for several years, but this is my first iPhone app using it and I can't understand why the SWF works fine but the iPhone app is so slow. Any help or advice would be GREATLY appreciated.
Thanks!

Forget the timeline and do something like this:
Import your images to library and turn on Export for Actionscript, name your images and create an array:
     private var bgImgArr                    :Array = new Array("bg_abstract", "bg_bamboo", "bg_bars", "bg_candy");
Write a method similar to this:
        private function setBgImage(str:String):void
            if (currentBgImg && this.contains(currentBgImg) ) removeChild(currentBgImg);
            var bgClassReference:* = getDefinitionByName(str);
            var bgInstance:BitmapData = new bgClassReference();
            currentBgImg = new Bitmap( bgInstance );
            addChild(currentBgImg);
Call it like this:
setBgImage(bgImgArr[ SOME_INDEX ]);
Runs smoothly on iPhone 3G with any number of images. I just used similar approach in my latest iPhone game Blockslide: http://itunes.apple.com/us/app/blockslide/id431490534?mt=8&ls=1

Similar Messages

  • I have itunee 11 and iphone 4 and i can't sync my apps to the iphone. it just stops on "determining apps to sync".please help

    i have itunee 11 and iphone 4 and i can't sync my apps to the iphone. it just stops on "determining apps to sync".please help

    it is an itouch, i buy apps from the app store, they are purchased, they show up in my app section but when i try to sync them to my itouch they do not show up in on the itouch. i have tried to atuthorize and deauthorize the computer also few times, rebooted computer and still nothing. when i restore the firmware and have everything reinstall all over again the apps music and such, all show up. however if i buy a new app and try to sync it with the itouch it does not show up despite the fact that the computer states 'installing "......" whatever app. it happens with numerous apps, there is no rhyme and reason to why certain apps just do not show up on the itouch. the authorize/deauthorize deal does nothing to rectify the situtaion. any other ideas ?

  • Hi, we just bought a Macbook air and we can't find the 'reminders' app in the applications or through the spotlight search. Is there a link to download the app? I can't find it online or through the app store. Please help!

    Hi, we just bought a Macbook air and we can't find the 'reminders' app in the applications or through the spotlight search. Is there a link to download the app? I can't find it online or through the app store. Please help!

    Reminders is automatically installed with 10.8 or above. A new Mac should have 10.9; it's possible that, with a third-party vendor, you have an earlier OS. Check under the Apple menu in the top left and click About This Mac. That will tell you what version of OS X you have.
    Matt

  • HT201272 Im unable to find deteted apps in purchased section in App Store ..please help me in restoring the deleted app

    Im unable to find deteted apps in purchased section in App Store ..please help me in restoring the deleted app

    Is the app still in your country's store (if it isn't then you won't be able to redownload it), you haven't changed countries since buying it (content is tied to the country as well as the account), and it isn't hidden : http://support.apple.com/kb/HT4919 ?
    If the app is no longer in your country's store then do you have a copy of it on your computer's iTunes library and/or on your backup of your downloads/library ?

  • HT4009 I did not download the in-app purchase at time of original App download, now I cannot figure out how to find and download the in-app purchase.  Please help!

    did not download the in-app purchase at time of original App download, now I cannot figure out how to find and download the in-app purchase.  Please help!

    Hello paddyliverpool,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/ht1933
    Refund is an option.
    Best of luck,
    Mario

  • I created my itunes account YEARS ago!! And I can't remember the answers to my security questions? Because I cannot remember the answers I cannot make purchases in the app store. Please help me create new security questions.

    I created my itunes account YEARS ago!! And I can't remember the answers to my security questions? Because I cannot remember the answers I cannot make purchases in the app store. Please help me create new security questions. Please help me.

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps you get the questions reset :https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support :http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing the number for Apple  in your country and ask to talk to the Account Security Team : http://support.apple.com/kb/HE57

  • I cannot download any apps on IPhone 5. It keeps saying "cannot connect to itunes store" even when I am perfectly logged in Itunes Store and App Store. Please help !

    I cannot download any apps on IPhone 5. It keeps saying "cannot connect to itunes store" even when I am perfectly logged in Itunes Store and App Store. Please help !

    I have this problem too since ios6 upgrade.
    4S iphone  I can connect to itunes on 3g and download an app no problem.
    I can connect to wifi no problem and use safari , facebook etc...I can connect to appstore but cannot install any apps over the wifi. 'Unable to conect to itunes'.....
    Driving me insane.............

  • Hello I want to change the plan Single App to Photography please help and thank you

    Hello I want to change the plan Single App to Photography please help and thank you

    Hi Rasheed,
    Contact Adobe support for that: https://helpx.adobe.com/contact.html
    Thanks,
    Kevin

  • App error 552 PLEASE HELP ME!!!

    Hi for days now i have had a white screen and small writing on saying app error 552. The phone will not come on at all, just resets to the same screen so I cant do anything via the phone. 
    I asked on my facebook and was giving a link to try for some software. I downloaded it and it recognised my phone (well i think it did) but kept saying no updates available. and wouldnt do anything basically could not choose options or device as no highlighted options. 
    I was then told today to download another which i did, I downloaded blackberry device software for my phone and installed. 
    After installation and On starting the program, it comes up with : Devie connection, enter pin?
    It does not have any options and wont let me input anything in to it. 
    I was told if I got the software I could plug in to the computer via a usb and do a master reset, or reset and delete all files and hardware and this would sort out the problem. 
    I just need help, i can do it if i have clear instructions to read, simpler the better lol. I dont want to have to get a new phone. 
    I dont care if i lose everything as long as i cn use it and get stuff back on it.
    Please help all suggestions welcome. 

    Hello,
    First, start with this reference:
    Article ID: KB18751 Error "Reload Software: 552" is displayed on the BlackBerry smartphone
    Next, please conduct these steps as preparation:
    1) Make sure you have a current and complete backup of your BB...you can find complete instructions via the link in my auto-sig below. (this is likely moot in your situation)
    2) Uninstall, from your PC, any BB OS packages
    3) Make sure you have the BB Desktop Software already installed
    http://us.blackberry.com/software/desktop.html
    4) Download and install, to your PC, the BB OS package you desire:
    http://us.blackberry.com/support/downloads/downloa​d_sites.jsp
    It is sorted first by carrier -- so if all you want are the OS levels your carrier supports, your search will be quick. However, some carriers are much slower than others to release updates. To truly seek out the most up-to-date OS package for your BB, you must dig through and find all carriers that support your specific model BB, and then compare the OS levels that they support.
    5) Delete, on your PC, all copies of VENDOR.XML...there will be at least one, and perhaps 2, and they will be located in or similarly to (it changes based on your Windows version) these folders:
    C:\Program Files (x86)\Common Files\Research In Motion\AppLoader
    C:\Users\(your Windows UserName)\AppData\Roaming\Research In Motion\BlackBerry\Loader XML
    Now, attempt to use these tricks..however, please substitute the Desktop Sofware or LOADER.EXE from the above rather than any update website they may direct you to:
    KB10144 How to force the detection of the BlackBerry smartphone using Application Loader
    KB27956 How to recover a BlackBerry smartphone from any state
    http://crackberry.com/blackberry-101-lecture-12-ho​w-reload-operating-system-nuked-blackberry
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • 1 second "Play / Pause" lag - please help me!!

    Hi all, in Adobe Premiere Pro CS3, After Effects and Soundbooth for that matter, whenever I press "play" on the timeline, there is a 1 second pause/lag before the footage starts playing.
    For editing, this is a nightmare, obviously you want precision when you edit and i have no idea what is causing this on these products.. please help if you can.
    Imagine if when you are typing a reply, there's a one second lag between when you press a key on the keyboard and when it gets shown on the monitor, that's what it feels like right now.
    When I press spacebar again to STOP, it STOPS just like normal. There is no lag. However - when I press spacebar again to start it playing, everytime, a one-second pause.
    I have installed Sony Vegas, there is no play/pause lag at all. so it MUST be a setting or tweak within Adobe Premiere that can fix this.. please..!
    My settings are well over requirements, I also wondered if it was "pre-roll", but changing that and "post-roll" to 0.00 seconds from 2.00 seconds did nothing. still the lag.
    i also pushed DirectX sound acceleration from FULL to Standard, did nothing. still lag.
    So here are my specs:
    Intel Quad Core, 4x 3.2ghz,
    2gb DDR2 RAM,
    768mb 8800 GTX,
    500gb 7200rpm hard drive,
    Windows XP Professional SP2,
    please help me if you have an answer.. is there a simple play setting i'm missing? some sort of hidden buffer i need to set to 0 instead of 1?
    it must be something within Adobe, because Vegas' timeline plays with no lag or pause at all.. but I NEED my Premiere Pro..!
    thank you so much for your help
    jay

    I have just discovered a solution that seems to remedy this problem on my system. Though it is likely very specific to my configuration, I thought I'd pass along what I found. Perhaps it will be of direct help to someone and/or spark a thought about what the actual underlying cause might be.
    I have Computer Associates CA Anti-Virus on this system. This program has a feature that lets you put real-time virus scanning to "sleep" for up to 999 minutes. If I put CA Anti-Virus to sleep, and then launch Premiere Pro CS3, the project loads much faster and all the playback pauses/delays disappear. So, putting CA to sleep is now part of my routine before launching Premiere Pro CS3. When I do this, the program is usable.
    Interestingly, during the project loading delay and during the playback delays, there was absolutely no disk activity on any drive, and Task Manager showed that Premiere Pro CS3 was taking 100% of the CPU. The CA Anti-Virus services are running but effectively show 0% CPU time. So whatever is happening (in-memory scanning of the loaded files, perhaps?) is being fully charged to Premiere and not to the antivirus scanner.
    Also, it's interesting to note that the exact same antivirus software in its fully-enabled (non-sleepy) state has no such effect on either Premiere Pro 1.5 or Premiere 6.0 on the exact same system. When antivirus is fully enabled (not asleep), neither of these older Premieres have any delays in loading or playing back.
    Based on what I have read in the forums, it sounds like there are likely multiple issues that lead to these delay problems. In any case, the behavior is a pretty serious regression in Premiere, and Adobe should add this scenario to their regressions testing suite.

  • Just did a restore but only 30 of my 250ish apps restored!  PLEASE HELP!

    Following the most recent ios version update, my iPhone 5 completely crapped out and had that little usb symbol on the screen.  I called Apple...they walked me through transferring all my almost 3000 photos/videos to my computer (obviously not able to do through iTunes/iCloud when my phone wasn't functioning).  I asked if everything else (about 250 apps...no music) would be in the most recent cloud backup which was only a couple hours before the phone crapped out.  They said yes.  I did the restore and only about 30 of my 250ish apps restored!  I never saw all my apps in my iTunes for some reason and all the apps that I can see in my iTunes have been restored.  I wasn't at capacity for iCloud storage either because it happened a couple months ago and I bought more storage space.  I've only been an iPhone user since Dec 2012 so PLEASE HELP if you can and let me know if there is anymore inof you need from me to help me troubleshoot.
    PS=I use a good 30-40 of those apps while I'm running experiential marketing campaigns in the field...one of which is a HUGE campaign I'm managing starting tomorrow.  I'm toally FREAKING out right now with my apps not all restored even though the restore is complete.
    PLEASE HELP
    -super grateful in advance Julia

    If you desire to have everything that is currently on the device safe and available to restore, don't just sync, backup the device.  A backup via iTunes will sync and transfer iTunes purchases to iTunes on the computer.
    Also, copy any pictures taken with the device off to the computer for safekeeping.
    Hopefully contacts are already synced with a supported application on the computer or a cloud service, if not, set that up before restoring.

  • HT201210 my iPhone won't let me change my email when I go to update my apps... please help!!!

    I made the mistake of changing my email, however because it was an email that wasn't activated anymore I thought it would be in my best interest to do so. However with a new email came a new password ... and it seems that my phone can't accept the fact that I changed my email, and won't let me change it - so my password is Always wrong, when I know it's not. How do I change my email? I am about the restore my phone to factory settings... but I'm hoping that is a last resort... please help!
    much appreciated!

    Try clearing Safari's cache : Settings > Safari > Clear Cache (and Clear History)
    If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • How can i fix my iphone? it wont let me send or receive text messages, also my apps wont open. please help?

    when i try to reply to a text and click the send button it just closes down my messages.
    and when i tap on my apps it just returns to my homescreen.
    i cant back-up my iphone and i have pictures etc that i dont want to lose through restoring it.
    please help me?

    Why can't you back up your phone? Connect it to any PC with iTunes, and right click on your device. Backup should appear, and this will back up your device.
    Restoring it is the best option, upon completing a backup, you won't lose any core data (such as photos). You may just want to import your photos first to a program or your computer. Then they won't be lost.

  • How to get photos off my iPod that were on a app?? PLEASE HELP _ !!!

    I dropped my cracked iPod touch 4th generation in water and now it's just done. The touch doesn't work anymore (by that I mean I cant touch it anymore, I cant slide it open or slide it to turn it off). It wouldn't really be a big problem cause I plugged a USB cord in my iPod into my laptop and it downloaded all my photos from my iPod onto my laptop. The problem is I had a lock app (that kind of app that you can keep private stuff in/the app you need a password for) and I had many pics of memories on there that I will never get back. They didn't download onto my laptop like the rest cause they are not technically on my iPod, they're on a app.  I have been trying to find a way to get those pics onto my laptop but with my iPod unable to open I have just given up. I would take it to a shop but they would probably just reset it and delete everything. You guys are my last hope. Is there ANY way I can some how save those pics?? If not tell me because keeping this iPod around is just saddening :/ PLEASE HELP! (I don't know if this is useful information but My Ipod was NOT a IOS 7, it was a 6 something.. I dont remember exactly but It was not a 7, but a 6. something)

    Can you backup the iPod? If so then either:
    - Restore another iPod touch, iPad or iPhone for that backup
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store
    If you have an iTunes backup you may be able to extract the photos from the backup by:
    How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html
    If iTunes sees the iP then yo maybe be able to use a program like iFunBox or TouchCopy to get the photos fro the iPod

  • Apple ID issues? i think i have two accounts but i cannot find out the password for the one that controols my apps!? please help!

    I think I have two apple ID accounts.
    The account I am using right now is Alexiaann22. Im like 99.9999% possitive that before this was my origonal account(rosepetttals).
    When I am buying an app in the app store the apple id is already there and all you have to do is change the password. But the apple ID thaat is there is the Rosepetttals.
    I am no longer using that email so I cannot get the password sent to it. I also cannot retrieve the password for rosepetttals because it says that the birthday I am entering is incorrect. but im pretty sure I would know my own birthday.
    I know its alittle confusing but I would appreciate any feedback. Thanks you! 

    I am having this same issue, please help asap... I cannot listen to half of my music library and have never encountered this issue before.

Maybe you are looking for

  • G4 powerbook adapter plugs/tips

    I have had the unfortunate repetitive occasion of seeing the wiring going into the older style G4 powerbook tips gradually get loosened and then break off. I successfully resoldered one of them, but I have at least two others, one of which I tried to

  • How to define a custome property in User Profile to Save Roles Sort priority ?

    Hi All, I have a requirement where in, user should get an option to decide his default tab(role), when he logs into portal. e.g.: If user1 and User2 is assigned with 2 roles namely Leave & Travel. User1 should be able to select Leave as his default t

  • Filename of downloaded Excel file

    I frequently download Excel files from a website that seems for the most part windows centric. These excel files have an extension of .xls, I can double click them to open, but when opened they just have the file name of WORKSHEET. If I rename the fi

  • Graphic Columns and texts

    Hi there I want to make a Graph in my Reports 6i builder that makes reviewing for 2 columns ( THe gain and the Loss) And a text over them FOr the Percent of the gain over the loss (BUt I dont want to make a 3rd column for it)

  • Restrict authorization to Customer data.

    Hi, We are working for a Telecom based client. The client has a data security issue and wants to restrict our consultants from viewing all the data related to few sensitive customer.  Is it possible to restrict the users from viewing or changing the