AS2 / AS3 Flash Preloader issue.

[ moved from AS1/2 forum ]
Hi every one,
I'm testing the new capabilities on Flash Pro CS6. And I'm stuck around here as most of my coding are AS1 / AS2 and when I try to make the coding for AS3 one part of my pre-loading is not functional any more. Basically the Dynamic Text does not shows up. Maybe if you take a look into my code you can tell me where I'm wrong.
This is the new AS3 code for my preload scene. I have created this stage to load just one image on the 2nd frame. And it works except for the text that it does not displays the text inside the following instances: percent_txt, ofBytes_txt and totalBytes_txt
I appreciate any ideas you may provide to me pls.
stop();
addEventListener(Event.ENTER_FRAME, loaderF);
function loaderF(e:Event):void{
          var toLoad:Number = loaderInfo.bytesTotal;
          var loaded:Number = loaderInfo.bytesLoaded;
          var total:Number = loaded/toLoad;
          if(loaded == toLoad) {
  removeEventListener(Event.ENTER_FRAME, loaderF);
                    gotoAndStop(2);
          } else {
                    preloader_mc.preloaderFill_mc.scaleX = total;
                    preloader_mc.percent_txt.text = Math.floor(total*100)+ "%";
                    preloader_mc.ofBytes_txt.text = loaded + "bytes";
                    preloader_mc.totalBytes_txt.text = toLoad + "bytes";
This is the result when testing,
Thank you so much and kind regards !!
Joel.

You have to set the values initally
stop();
addEventListener(Event.ENTER_FRAME, loaderF);
function loaderF(e:Event):void{
          var toLoad:Number = loaderInfo.bytesTotal;
          var loaded:Number = loaderInfo.bytesLoaded;
          var total:Number = loaded/toLoad;
          preloader_mc.preloaderFill_mc.scaleX = total; 
          preloader_mc.percent_txt.text = Math.floor(total*100)+ "%";
          preloader_mc.ofBytes_txt.text = loaded + "bytes";
          preloader_mc.totalBytes_txt.text = toLoad + "bytes";
     if(loaded == toLoad) {
       removeEventListener(Event.ENTER_FRAME, loaderF);
                    gotoAndStop(2);
what you original code was saying was after all the info was loaded to then set the text to the variables listed, you have to set it first and once the info is finally loaded go to the second frame.

Similar Messages

  • Help! - as3 IE preloader issues

    Ok,
    So, I work for the NPS, and they have an outdated CMS. I have no rights  to upload an .html file, or edit one that the CMS makes.
    SO, I am forced to use their little deal to display my .swf files.
    Problem:
    http://www.nps.gov/glca/photosmultimedia/ehikes.htm
    I made an eHike in as3 Flash CS4. It has two scenes, the first scene is  the preload, second is splash content and ehike content. The problem is I  cant get the preloader to display in IE. I have all actionscript  content exported to the second frame, as talked about here:
    http://www.senocular.com/flash/tutor...preloaderstart
    and it works fine in firefox.......
    GRRRR....
    I have tried many different ways to load the preloader..... Here is what  I'm currently using....
    there is a simple text field for the percentage, and a simple 100 frame  animation. preloader_mc
    stop();
    var preLoaderPercent:Number = 0;
    addEventListener(Event.ENTER_FRAME, loadComplete);
    function loadComplete(e:Event):void {
        if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal) {
        removeEventListener(Event.ENTER_FRAME, loadComplete);
        this.loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
        this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
        gotoAndPlay("splash", "content");
    }//loadComplete
    this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
    function loadProgress(e:ProgressEvent):void {
        preLoaderPercent = e.bytesLoaded / e.bytesTotal;
        load_txt.text = Math.ceil(preLoaderPercent * 100) + "%";
        var animstop:Number = Math.floor(preLoaderPercent*100);
        preloader_mc.gotoAndStop(animstop);
    The CMS lets you decide in the popup window if it is resizeable or not.  This works in IE (stopping people from resizing), but not in firefox,  people can resize it. Is there any way to disable the resize in AS3?  Again, I understand that your supposed to export the .html file with  these settings, but I have no permissions to upload or create new .html  files.
    Anyone who will help me with this - Thanks
    David

    The problem is talked about here:
    http://stackoverflow.com/questions/460677/serving-raw-swf-files-displays-in-firefox-but-no t-in-ie
    Solution was to preload with an external .swf
    Cheers

  • Flash Preloader Issue

    I have tried several methods of flash preloading for some
    large flash movies I have. The loader indicator flashes for just a
    brief moment and then there is blank data until the file loads. I
    am using Go-live CS2. I had a friend publish the same code using a
    different site and a different editor and it works. Does Go-live do
    something weird to preloaders? Or, is it possible that my site
    providers server is blocking script to prevent it from working? Any
    ideas would be appreciated. If you have a suggestion of a preloader
    that is for dummies like me, please send me a link. Thanks!

    http://www.actionscript.org/resources/articles/54/1/Smooth-PreLoader/Page1.html

  • AS3 Flash Preloader

    Hey Guys,
    I've been trying to get this preloader working for days! I finally got it working, and now when i upload it to my site and refresh the page, the .swf file is stuck at the preloader screen.
    This is my code:
    //Stop Frame
    stop();
    //Create a listener to call the loading function as the movie loads
    this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, loading);
    //Runs when the loading progress has changed
    function loading(event:ProgressEvent):void
    //Determine the percent loaded from bytesLoaded and bytesTotal
    var percent:Number = event.bytesLoaded / event.bytesTotal * 100;
    //Stretch a progress bar
    progressBar.scaleX = percent / 100;
    //Set the progressText text box to the percent loaded
    progressText.text = int(percent) + "%";
    //When the load is finished, go to frame 2
    if(percent == 100)
    this.gotoAndStop(2);
    I've been reading up on it for a while now, but I can't seem to figure it out. I'd really appreciate it if I can get some advice as to what to do.

    //Stop Frame
    stop();
    this.loaderInfo.addEventListener(Event.COMPLETE,f);
    function f(){
    this.gotoAndStop(2);
    //Create a listener to call the loading function as the movie loads
    this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, loading);
    //Runs when the loading progress has changed
    function loading(event:ProgressEvent):void
    //Determine the percent loaded from bytesLoaded and bytesTotal
    var percent:Number = event.bytesLoaded / event.bytesTotal * 100;
    //Stretch a progress bar
    progressBar.scaleX = percent / 100;
    //Set the progressText text box to the percent loaded
    progressText.text = int(percent) + "%";
    //When the load is finished, go to frame 2
    if(percent == 100)
    this.gotoAndStop(2);
    p.s.  please mark this thread as answered, if you can

  • AS3/Flash Dev Teams: Help me fix Flash's Clipboard API on Linux!

    Hello!
    I am hoping to get in touch with the Adobe development team responsible for the ActionScript framework (for Flash Player, in particular).  I would really like to work with them to fix this bug (or, hell, attempt to fix it myself if they'd give me access to their source control):
       https://bugbase.adobe.com/index.cfm?event=bug&id=3482860
    Long-story-short:
    The "System Clipboard" API (plain text format only) from Flash 9 worked wonderfully cross-platform (Windows, MacOSX, Linux).
    However, the AS3 "Desktop Clipboard" API (plain text, HTML, RTF, and custom formats) introduced in Flash 10 has issues on Linux.  In particular, it only set contents into a particular 1 of Linux's (X's) 3 clipboard/selection buffers, which prevents Linux users from pasting the copied contents into a Terminal session. The "System Clipboard" API from Flash 9 does not suffer from this problem.  (More background details are available in the Adobe bug linked above as well as the GitHub bug linked below).
    This bug has downstream ramifications for a relatively popular open source library (e.g. used by GitHub.com and bit.ly) that I maintain called ZeroClipboard:
       https://github.com/jonrohan/ZeroClipboard/issues/78
    As such, I would very much like to see these issues resolved, and am willing to actively help if at all possible.
    If there is a better way to get in touch with the AS3/Flash Dev Teams than the bugbase or these forums (e.g. a team email address, particular dev's Twitter account, etc.), please let me know. Thank you in advance!
    P.S. Yes, I know that Linux is no longer officially supported by Flash Player but I also know that Linux users still manage to install the latest versions of Flash with a few workarounds.  It is also heavily used by GitHub.com users, and is therefore a high priority user base for ZeroClipboard.
    P.P.S. I also tried to get a contact via the various Adobe/Flash/Flex Twitter accounts without any success.
    Sincerely,
       James M. Greene

    Epic failure. Worked hard to contact Adobe devs and finally got through to the team via their OSS director.  End result: they'll only do for security patches for Linux, won't even consider other bug fixes.

  • AS2 noScale and pixelation issue

    We are doing a number of banners for a client in AS2 using Flash 8 Pro. The version was their specification.
    Now I've generated a series of PNGs in photoshop at precisely the same dimensions an imported them directly into the Flash Library.The problem is, when we epublish this to HTML it scales up about 120% and pixelates badly. I've already explored a few workarounds to varying success. Allow me to explain:
    In the swf preview (Ctrl+Enter) I get no scale or pixelation issues. The render is clean and sized correctly. The scale problem is only happening in the HTML publishing.
    -I double checked the code on the HTML and the size specifications are the same as those in my FLA and PSD. Identical.
    -In the publishing settings I discovered that the noScale option prevented the issue, but only for the machine I was working on. None the other test machines saw any improvement in the published banner(we have 4).
    -I tried embedding a noScale Actionscript directly into the FLA. Same issues as above. Only the work PC displayed the correct size, the other machines did not.
    -I tried manually setting the HTML publish size specifications. Again, same problem.
    What's strange to me is that the noScale only corrects the problem for the machine the project was done on. Makes me think some caching is to blame for the misrepresentation. And the HTML Publish seems to be ignoring my size specifications for the SWF altogether. Can someone tell me why this is happening?

    Well it looks like I may have resolved this issue, sort of. John (owner of the tapes) let me borrow his camera for the experiment (Thanks). This is what I did with the theory that if I captured using a sony dcr-vx2000 pixelation would be reduced.
    The other night (late), I pulled some hurricane Katrina footage that I had not captured yet and capture it with the canon xl2. on playback of the capture NO PIXELATION was observed at all(I watched it three times). I took the originalvtapes that I worked with last week on the wedding and recaptured on the caon xl2. Resulted in occasional pixelation. I then took the same tape and re captured it from the sony camera. Resulted in NO pixelation when playback observed on a tv and on pc screen.
    Conclusion:
    even though ths is not scientifically provef true or fals, I observed that to capture from a mini dv tape if shot on sony camera, you need to use a sony camera for capture. Same thingapplies with canon.
    Note: Canon and Sony, please address these issues as a professional courtesy to the rest of your customers. Thank you.

  • AS3 depth management issue

    Hello folks! Looking for a little technical advice - let me
    explain:
    I'm converting a small flash game that I had built in flash 8
    with as2 to flash 9 with as3 and have hit a snag. The visible
    object on the stage in that application is simialr to a rubiks cube
    as seen from an upper corner (sort of an isometric view). There are
    mutliple rows and columns and levels...lets just say it's a 3x3x3
    cube. Through gameplay various cubes are moved around, added and
    removed from the grid, sometimes a slot is empty sometimes full. In
    order to track this and make sure that the cubes stay at the proper
    depth relative to each other I had assigned each slot in the full
    grid a grid number incremented by 10's for rowsand 100's for layers
    and stored the numbers in an array. Then when I added a cube to the
    stage I just looked up its depth value from the array, attached it
    and appended its number to it's instance name and set it's depth to
    the same number . Nothing ever got at an improper depth becuase
    every slot had a fixed absolute number that could be pulled from
    the array. My problem is that the new depth manager won't allow
    gaps - each depth needs to be used before the next one can be used,
    and that when you insert someting at an occupied depth everything
    above it is pushed up by one so I can't track any of my cubes depth
    as I had been becuase they keep changing.
    Example: I'm my old system if I needed to move the first row
    of cubes from the 3rd layer (cubes 310, 320, 330) straight down
    into the second layer I would simply move them then swapdepth to
    210, 220, 230. In the new system since i cant reserve a depth for
    an empty slot I never know what number to move the cube to without
    a convoluted lookup process, and once I do move it...every single
    depth after it gets altered (which seems like a lot of extra work
    for the system by the way)
    So...anyone know a better way to manage depths of a 3
    dimensional grid in as3?

    Personally, I think the new depth system introduces more
    problems than it fixes.
    One advantage in AS3, though, is that you can move a
    DisplayObject from one DisplayObjectContainer to another.
    [edit] Oops, GWD already mentioned this, so I'm basically
    re-iterating what he said [/edit]
    So based on your setup, it might be helpful to make different
    container clips for each "layer" as you described it. Then you can
    simply move the rows into the different containers, and the
    containers are at different depths.

  • [svn:osmf:] 14713: Fixed preloader issue with work around.

    Revision: 14713
    Revision: 14713
    Author:   [email protected]
    Date:     2010-03-11 12:44:27 -0800 (Thu, 11 Mar 2010)
    Log Message:
    Fixed preloader issue with work around.   Underlying flash player bug filed.  https://bugs.adobe.com/jira/browse/FP-4114
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FP-4114
    Modified Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/AllExamples.as

    Thanks Very much for the reply.
    This issue came to development (we) through Support team only. Did you mean DB Team Support?.
    Also please let us know about the workaround suggested by DB Team.
    Thanks in advance.
    Joseph George

  • Flash Player Issue with Windows 8.1 Professional

    Hi guys,
    I'm currently having issues with Flash Player on Internet Explorer 11 in Windows 8.1. It seems that the Flash Player has been disabled when I access http://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-8.html.
    However, when I logged off the my domain account and use my local account, I'm able to test Flash Player.
    Therefore, the only thing I can think of is the Group Policy that is blocking the Flash Player as I've resetted IE settings on my domain account.
    Hopefully you guys are able to solve this mystery.
    Thanks!!

    Go to control panel and go to program and features and uninstall existing adobe player
    and adobe flash player activex both....
    Then select windows 8 and flash player  from here http://get.adobe.com/flashplayer/otherversions/
    Install and check.. 
    Hetti Arachchige V Aravinda | Network & System Administrator (B.Sc,MCP, MCTS, MCSA, MCSE,MCITP, CCNA, CEH, MBCS)| http://www.windowstechinfo.com |

  • AS2 Certificate widget scoring issue

    I received a fix from someone on the Captivate forum that is supposed to fix the AS2 Certificate widget scoring issue. The results on my Score Results page appear correctly, but the results on the certificate do not match those on the Score Results page. I tried to use the fix the provided (another widget that you insert at the beginning of the project) but it did not solve my problem. I am desperate for a solution to this and have tested the project what feels like 100 times to try to figure out how to fix this problem. I apologize in advance if this has been addressed in another string. I have spent a great deal of time going through the forums and have found some discussion on this issue, but no concrete solution anywhere. Can anyone offer any insight?
    FYI: I am using Captivate 4 and my project is set to AS2.
    Thanks!

    Weird ... I need to ask a totally unrelated question and came to the forum using a link I'd bookmarked ... to the "Certificate Not Widget Scoring Correctly" thread. And here's your post at the top of the list.
    I haven't played with scoring in quite awhile, so I'm not much help and maybe you've already read this thread, but just in case: here's the link: http://forums.adobe.com/thread/598503.
    Hope it's helpful.

  • Pure AS3 self-preloader

    My project originally had everything on the timeline, but I have since moved all the code to the document class, but some of my assets are still in the library and some of them are embedded. I'm trying to make a self-preloader that doesn't use any external files, but I can't seem to find a good tutorial that doesn't involve using the timeline. Can anyone point me to a pure AS3 self-preloader tutorial or tell me where I'm supposed to put everything?

    If you mean by "self-preloader" a pure Standalone as3 preloader:
    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    //this line has to be adapted to the name of your document class
    l.load(new URLRequest("main.swf"));
    function loop(e:ProgressEvent):void
        var kBytesLoaded:int = Math.round(e.bytesLoaded/1024);
        var kBytesTotal:int = Math.round(e.bytesTotal/1024);
        var perc:Number = kBytesLoaded / kBytesTotal;
        trace("PERCENT:"+perc);
    function done(e:Event):void
        //this line for the stuff you might need to visually communicate the loading process and want to remove when loading is done
        removeChildAt(0);
        addChild(l);

  • Nokia C5 flash light issue

    Hi, First i set the flash light off to capture images in daylight.It worked fine.I exited the camera then and reopened it.Now i tried to take a picture using camera and flash light was on now. Why the camera is not able to remember its previous flash light mode....

    I love my C5 .
    My phone does not have flash light issue .
    I brought it from US directly to my home town .
    And this was only possible with the help of http://www.viaddress.com) The Global Leader in Package Forwarding.
    This company is very cheap and relieble too .
    I really recommend you all for shopping from US
    Thanks
    Attachments:
    donkey.jpg ‏33 KB

  • Flash Preloading - Not Simple

    I am new, but to the extent that I have a full flash site
    that works great. I cannot get any preloaders to work. Lets be
    honest, I cannot even begin. Everyone assumes an expert, even the
    'simple flash preloader' sites.
    Why not just use the component in Flash CS3? Why can't Adobe
    help with this instead of sending me to google to get preloader
    ideas? Why is the WMODE=transparent command not recommended if you
    want transparency (as a supposive fix to the white box)? Preloaders
    are not simple for non-developers.
    Simply, I have a background.jpg in an HTML document. I load a
    flash in a table on top. It shows white in the table before the
    flash loads. Adobe's answer is to use a preloader. OK. Great. I
    found several, all of which insert so many variables that I can't
    tell what is really a variable or not. I have no desire to become a
    preloader retailer....OK? I just need a preloader. Explicatives
    removed. I simply want to load literally "video1.swf" without
    getting a white box. A progress bar would be nice. Will this be a
    seperate flash (swf), or will it be inserted in the timeline as
    seperate layers in the timeline to play before the original frames?
    Must I combine my original video1 file into a movie symbol, then
    manipulate it in another timeline with a preloader?
    Please do not assume ANYTHING. I need to get this done once
    and for all.
    Please, just make it simple. Attached is some code I found.
    Can it be edited to work with the "ProgressBar" in CS3? If there is
    an option, a seperate swf would be better as I have several pages
    that are setup the exact same way.
    Thank you.

    Seeing white is nothing to do with a preloader - set the bg
    of your movie to
    other than white. If you're using something like SWFObject to
    embed your
    Flash in the HTML, make sure it's not set to a white bg also.
    Aside from that a preloader is not too difficult to build -
    and the code you
    gave as a sample is bad code, which is likely the source of
    your problems. I
    don't have Flash 9 yet, but in 8 you would want to use the
    MovieClipLoader
    class to load in your swf. It has an onLoadProgress method
    that you can make
    use of to build a progress bar.
    Try this for a tutorial:
    http://www.kirupa.com/developer/actionscript/moviecliploader.htm
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Camera flash light issue

    I have purchased Xperia Z1 in Feburary 2014 and having flash light issue in Photos. If i click without flash then image comes fine but if i click with flash then at the bottom of Image(flash side) there is a extra light comes which is flash light. And that flash look more ugly if i click in low light enviroment. I used all of settings (Auto, Daylight, Night Scene). In all setting if i click in low light there is extra flash comes in Image.
    Note : My Xperia is full update using sony update.

    Hi and welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    I suggest that you have your phone examined by a service center. Please contact your local Xperia support team for more information:
    http://www.sonymobile.com/global-en/support/contact-us/
    What are your thoughts about this forum? Let us know by doing this short survey.

  • Installing Flash Player Issues

    I have a Windows 8 Operating Sysytem and I use IE version 8. I have downloaded the latest flash player numerous times and it continues not to work. So can someone please help me install it?????? Thanks in advance

    If you have Windows 8, you CANNOT use IE 8, because Windows 8 comes with IE 10 preinstalled and it WON'T accept a lower version.
    In addition, Flash Player for IE in Windows 8 is modified and embedded by Microsoft. It's "their baby" so to speak. It can ONLY be updated through Windows Update (in your Control Panel under System and Security).
    Microsoft released a "Tuesday patch" November 12 to update Flash Player for IE10 and IE11 in Windows 8 and 8.1.
    If you run the update and still have problems, see: http://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-8.html for more steps to take.

Maybe you are looking for

  • Getting Error while creating Project through API:PA_PROJECT_PUB.CREATE_PROJ

    Hi Gurus, I'm getting an error while creating a New project. My code looks like this: APPS.PA_PROJECT_PUB.CREATE_PROJECT (p_api_version_number => l_object_version_number --IN Parameter ,p_commit => l_commit --IN Parameter ,p_init_msg_list => l_init_m

  • Help with buttons in gui

    I need to create first, last, next, and previous buttons in my gui. I have them in there (in the code), but only one button shows up (instead of four), and it has "first" overlapped with the "previous" button. The "next" and "last" don't even show up

  • How can I get rid of files that cannot be imported error message

    Hello, this is my first post. I am a new mac user. I have imported my jpgs from an external hard drive which was in the most part successful, however, 14 of the files appear to be corrupted and every time I open iphoto9, I get the error message, '14

  • Abap code used for reporting

    Hi Gurus; Can some one send me the abap codes used mainly for reporting OR can some one give me some sample code used in reporting. my mail id "[email protected]".

  • Instant client for Solaris AMD x64

    Hi, I am desperately looking for OCI instant client for solaris AMD x64. I tried instant client download page (http://www.oracle.com/technology/software/tech/oci/instantclient/index.html) but it is not listed there. I have no idea who to contact with