Logical Arrangement of Preloader Script

Hi,
I have created one swf which does following two things;
1. Once it gets loaded in HTML on server it will pass Flashvar to HTML. if flash var from swf and HTML both will match then only swf should play.
2. It will also have Preloader
independently both the scripts work perfectly. But when i compile both in one file then it dosent work in following cases;
Case 1- preloader script first and then flashvar:= this preloads file perfectly but dosent pass flashvar
Case 2- flashvar first and then Preloader:= this works perfectly when i test my file Locally but once i upload it to server then it dosent work for Preloader
what should be my logical sequence or options in this?
I am using "Event.ENTER_FRAME" for Preloder and "Event.COMPLETE" for flashvar...is there any mistake?
//////////////PRELOADER//////////////////
stop();
this.addEventListener(Event.ENTER_FRAME, myMovieLoading);
function myMovieLoading(e:Event):void {
    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;
    preloader_mc.bar_mc.scaleX = loaded/total;
    loadInfoText.text = Math.floor((loaded/total)*100)+ "%";
    if (total == loaded) {
        play();
        this.removeEventListener(Event.ENTER_FRAME, myMovieLoading);
////////////INITIALISING MOVIE///////////////
var keyLoader:URLLoader = new URLLoader();
keyLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
keyLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
keyLoader.addEventListener(Event.COMPLETE, loading);
keyLoader.load(new URLRequest("C:/keytext.txt"));
function onLoadError(evt:IOErrorEvent):void
    loadmyHTML();
var myFlashVar:String;
var ver:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (ver in paramObj)
    myFlashVar = String(paramObj[ver]);
function loading(event:Event):void
    if (keyLoader.data.passKey == "pass1")
    else if (myFlashVar=="pass1")
    else
        stop();
        parent.removeChild(this);
function loadmyHTML():void
    if (myFlashVar!="pass1")
        stop();
        parent.removeChild(this);

in your loaded code there is
keyLoader.load(new URLRequest("C:/keytext.txt"));
please see this will not be found on the server thus it may have problem in loading it on serveer while it run local machine. please try replacing the keytext.txt file path to a relative path which can also be found on the server.
hope this would help you,

Similar Messages

  • External preloader script problem

    hi, i'm try to create an external preloader, i've made three layers (the script, one for a funky design of my logo and keep things simple i've also embedded the preloader text in this layer and finally the preloader bar beneath. i've created two frames for each layer, the script has two keyframes, the other layers only have a keyframe first then a standard frame. i can't get it work though, please help. here's the script i'm using on the second keyframe.
    var loader:MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("Empty_movieclip",1);
    loader.loadClip("Creative-Outrage.swf",Empty_movieclip);
    var preload:Object = new Object();
    loader.addListener(preload);
    preload.onLoadProgress = function (target, loadedBytes, totalBytes){
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    gotoAndPlay(1);
    else (loadMovie("Creative-Outrage.swf",Empty_movieclip));
    removeMovieClip("Preloader_movieclip");
    Bar_movieclip._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    Preloader_movieclip.Loader_text.text=Math.round((_root.getBytesLoaded()/_root.getBytesTota l())*100)+"% Complete";

    try: 
    var loader:MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("Empty_movieclip",1);
    // move the next line to the end of your code
    loader.loadClip("Creative-Outrage.swf",Empty_movieclip);
    var preload:Object = new Object();
    loader.addListener(preload);
    // the next two lines should be in preload.onLoadProgress
    //Preloader_movieclip.Bar_movieclip._xscale=(loadedBytes/totalBytes)*100;
    //Preloader_movieclip.Loader_text=Math.round((loadedBytes/totalBytes)*100)+"% Complete";
    preload.onLoadProgress = function (target,loadedBytes,totalBytes){
    if (loadedBytes = totalBytes){
    // (loadMovie("Creative-Outrage.swf",Empty_movieclip));  <-- comment out or remove this line
    removeMovieClip("Preloader_movieclip");
    else {
    gotoAndPlay(1);
    it's still not displaying any gradual progress, it just displays the full progress bar immediately even when i simulate a download and it's not loading the external file either.

  • Preloader script

    I am new to scripting, so this is probably a pretty easy fix.
    I have the
    following code for my preloader:
    onClipEvent (load) {
    total = _parent.getBytesTotal();
    onClipEvent (enterFrame) {
    loaded = _parent.getBytesLoaded();
    percent = int(loaded/total*100);
    perc1 = ""+percent+"%";
    gotoAndStop(percent);
    if (loaded == total) {
    _parent.gotoAndPlay(2);
    As of now, the clip loads fine in another swf, but I want
    the clip to start
    playing before is has fully been loaded so that it cuts down
    on the time the
    viewer has to wait, say at 75% loaded, or 65% for example.
    How would I change
    the above code?
    Also, how would I change it to reflect in the percentage as
    well, for example,
    if it starts playing when it is really 65% loaded, how would
    the code change to
    show that it is fully loaded, in the percentage and the full
    loading bar, even
    though it really isn't...
    Does that make sense? Thanks for the help.

    what the 431,405 in your script?

  • Logic Pro won't open a Logic arrangement created in Logic Pro Educational

    Anyone experiencing this unusual problem. I am running a fully registered copy of Logic Pro on my MacBookPro. My client is using Logic Pro Educational copy, which expires in a few weeks from now. I have tried to open his arrangement/song files on my system. My Logic Pro won't even recognise what kind of file it is. Anyone know why this is happening? Very, very annoying when this is my line of work and income. If it's a security issue, then it should be the other way around. He shouldn't be able to open my files, hence me paying £700 for my licience. Any advice from anyone would be most helpful. I know someone will probably say...'well get your client to buy a full copy of Logic Pro' ... But it still won't solve this problem in accessing this work. Sometimes Apple...arghhhh!

    Thanks for your response. We actually tried it with another user who uses an educational copy. It worked straight away without any problems on his system. 'Corrupt file' is the error I'm getting though, so you're right there. The only thing I can think of is I'm using a MacBookPro and they are using the older Macs. Could it be a strange Intel problem? Very weird. Would love to get to the bottom of this. I am going to try loading it up on my friend's G5 to see if this is the case.
    Thanks.
    Nick.

  • Logic to run Unix script file through ABAP program

    Hi Friends,
    I need to run the Unix script file from abap program, for that user provided file directory of application server.
    Is there any logic/FM  to run through abap programing.
    pls can any one provide logic.
    Thanks,
    Ravi

    report zsrchsap.
    *-This is a demo report for Search Sap
    *-Author : Sandeep Kulkarni
    *-Date : 09/20/2001
    parameters : p_sfile(60) lower case
              "File to be moved
              "Eg : /home/in/SFILE1.txt
                p_dfile(60) lower case.
              "File's Destination
              "Eg: /home/archive/SFILE1.txt
    data : t_btcxpm
           like btcxpm occurs 0,
           p_addparam
           like sxpgcolist-parameters.
      concatenate
      '/home/ABAP/scripts/Archive_file.sh'
      p_sfile
      p_dfile
      into p_addparam separated by space.
      refresh t_btcxpm. clear t_btcxpm.
      call function 'SXPG_CALL_SYSTEM'
        exporting
          commandname = 'ZSHELL'
          additional_parameters = p_addparam
        tables
          exec_protocol = t_btcxpm
        exceptions
          no_permission              = 1
          command_not_found          = 2
          parameters_too_long        = 3
          security_risk              = 4
          wrong_check_call_interface = 5
          program_start_error        = 6
          program_termination_error  = 7
          x_error                    = 8
          parameter_expected         = 9
          too_many_parameters        = 10
          illegal_command            = 11
          others                     = 12.
      if sy-subrc = 0.
        write : /
        'File',p_sfile,'moved to',p_dfile.
      else.
        write : / 'Error Occured'.
      endif.

  • Preload script - Ignore if already cached?

    Hi all,
    I'm considering using the Script below (altered to fit my
    design) to preload the images prior to a site loading...but what I
    would like some help doing is altering the script so that it can
    skip the preload if the images its tasked to preload are already in
    the viewers cache... What do I need to add to do this?
    http://www.dynamicdrive.com/dynamicindex4/preloadimage.htm
    Cheers!

    Why? Are you wanting to 'preload' all the images on the site
    before opening
    the home page? I don't think that is a good idea.
    Preloading is not magic - it makes a 500K page act like a
    500K page, you
    know?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "nhavfx" <[email protected]> wrote in
    message
    news:e2aq4s$o80$[email protected]..
    > Hi all,
    >
    > I'm considering using this (altered to fit my design) to
    preload the
    > images
    > prior to the site loading...but what I would like some
    help doing is
    > altering
    > the script so that it can skip the preload if the images
    its tasked to
    > preload
    > are already in the viewers cache... What do I need to
    add to do this?
    >
    > Cheers!
    >
    >
    http://www.dynamicdrive.com/dynamicindex4/preloadimage.htm
    >

  • Help on internal preloader script

    Good day guys,
    Anyone could help me on this code.
    stop();
    this.addEventListener(Event.ENTER_FRAME, onPreloading);
    function onPreloading(e:Event):void{
      var total:Number = stage.loaderInfo.bytesTotal;
      var loaded:Number = stage.loaderInfo.bytesLoaded;
      var percent: Number = loaded / total;
      preloaderMC.loaderMC.scaleX = percent;
      preloaderMC.percentText.text = Math.ceil(percent * 100).toString() + "%";
      trace(percent);
    if (total == loaded){
      play();
      this.removeEventListener(Event.ENTER_FRAME, onPreloading);
    I got this code above preloading the main fla with a movieclip that is the preloader it resides on frame 1 both the preloaderMC and the code above.
    The problem goes when I simulate download which would show the preloader runnning but the text with the percent sign animates from 1% - 7% - 11% and back to 0%
    It did'nt animate from 1 - 100%.
    Any help is greatly appreciated.

    That's it embedding fonts.
    But as far as I can remember I did it already but when I copy all objects to another .fla file. I should repeat the embed font.
    I should click the correct answer button here.
    Thanks you Sir

  • Preloader Script Problem

    Hi;
    Please advise on this error:
    Scene 1, Layer 'PreLoader', Frame 1, Line 1
    1087: Syntax Error: extra characters found after end of program
    onClipEvent (enterFrame) {
            loading = _parent.getBytesLoaded();
            total = _parent.getBytesTotal();
        if (percent == undefined) percent = 0;
            percent -= (percent-((loading/total)*100))*.25;
            per = int(percent);
            percentage = per+"%";
            loadBar._width = per;
            if (percent>99) {
                    _parent.gotoAndStop(2);
    TIA,
    beno

    that's as2 and in as2 that code would have to be attached to a movieclip, not a timeline.
    in as3, no code can be attached to an object.  as3 does have an enterframe event.
    attached to your main timeline:
    this.addEventListener(Event.ENTER_FRAME,f);
    var percent:Number=0
    function f(e:Event){
        var loading:uint = loaderInfo.bytesLoaded;
            var total:uint = loaderInfo.bytesTotal;
            percent -= (percent-((loading/total)*100))*.25;
            loadBar.width = percent;
            if (percent>99) {
           gotoAndStop(2);

  • Slow page loading.  know any good preloading scripts?

    Go to:
    http://southpacific.com/kevin.html
    it takes forever for the page to load. Any know of any
    scripts that can speed this up or tips to make things run
    smoother?

    have a look
    Here.
    Mostly, you probably need to load your content in externally, and
    not have all your assets in the FLA to begin with. There is no such
    script that will speed up loading.

  • Script Logic choice SQL or MDX in NW release?

    Hi experts,
    I have encountered some opposite arguments in forum. Please can you clarify NW release script logic choice should be as MS release?
    In [Script Logic BPC MS (SQL) vs. NW (ABAP); Tim Klem states
    - "Write the logic using BPC SQL script logic syntax (not MDX) for performance reasons" but this opinion based on MS version. How about NW release is it really smarter to select SQL Script rather than MDX.
    There is another statement in [Re: BPC 7 NW; Deppak mentions that:
    - "In BPC 5.1 the script formula approach suggests to use SQL based logic instead of MDX.
    Whereas in Teched,08, I learnt that MDX & ABAP (using BADIs) would be used for it. Thats why I am slightly confused...."
    But second statement is far beyond NW relase date and I am sure this is not true but I would like you to confirm that.
    If you were a project responsible and want that all scripts will be held in one language, what would you choose??
    Thanks in advance,
    ergin ozturk

    Hi Ergin,
    I can understand your approach not to use ABAP hence you miss the skills witin your project team.
    However, you (or you client) has chosen the NetWeaver version for whatever reason. I'm sure a thorough decisions process has lead to this decision. In choosing the NetWeaver version with SAP BI you will sooner or later come to the point that you will have to use ABAP if you like it or not. Especially when you start using further capabilities within NetWeaver and the BI solutions. So from my point of view ABAP knowledge is an essential skill you need in a project based on SAP NetWeaver anyway.
    Additionally I heared some statements that MDX is causing some performance issues on the NetWeaver version. This may have been fixed in the meantime with some SPs.
    As the SQL within the NetWeaver verison does not have the full functionality than it has in MS Version SQL is not an option for me.
    I do also not see the cost impact hence someone need to do the support anyway. In case of MDX you need an MDX developer, in case of ABAP and ABAP developer. Or a technical BPC consultant able to do the development (which I would recommend you should have in your project team anyway).
    So coming back to your original question, I would recommend to do as much as possible using ABAP BADIs.
    Cheers,
    Steffen

  • Send parameter from one script logic to another. SAP BPC 7.5 NW.

    Hello!
    Before i start, want to apologize for my English.
    We work on SAP BPC 7.5 for NetWeaver.
    In general,  we want to send parameter from one Script logic file to another script logic file.
    I will explain why :
    1. We have parametr like %C_CATEGORY_SET% (and another four parameter, like groups, currency and etc.) that work on one script(next, i will named it A_Script). 
           We will send this parametr from BPC EXCEL (we will create button, then use command MNU_eData_SelectPackage(we also set parameters) and run package that we need, also before we set script for this package by the SAP Guide. We send some data, and this A_Script work good. Everything that we want from this script work correctly. )
    2. Next we create another script(B_Script) , and we want use %C_CATEGORY_SET%, but we don't know how use this parametr, if we will just write this parametr on Script Logic,  apears error ("C_CATEGORYDATAVALUE" is not assigned to the Data Administrator). We try to solve this problem by using System_Constants.lgf, but we get error.
    Code:
    *DIM C_CATEGORY          WHAT=%C_CATEGORY_SET%;             WHERE=<<<;                   USING=<<<;    TOTAL=<<<
    *DIM C_ENTITY                 WHAT=%ENTITYSET%;                         WHERE=<<<;                  USING=<<<;      TOTAL=<<<
    *DIM GROUPS                   WHAT=%GROUPS_SET%;                    WHERE=<<<;                  USING=<<<;     TOTAL=<<<
    *DIM RPTCURRENCY         WHAT=%RPTCURRENCY_SET%;         WHERE=<<<;                  USING=<<<;      TOTAL=<<<
    *DIM TIME                          WHAT=%TIME_SET%;                          WHERE=<<<;                  USING=<<<;     TOTAL=<<<
    If we will change %C_CATEGORY_SET% for  ACTUAL, and also change another parameters, script will work, package will run correctly. But we need using parameters, because we didn't exactly what will choose our client.
    Our question have BPC Script Logic some kind of Globar Parameter(Variable), that we will set in A_Script, and then use them on B_Script?
    How can we define parameter from another script logic, maybe we should send it?
    Should we use System_Constants for solving this problem, if yes, how?
    Any help will be appreciated
    Best Regards,
    Erlan Kadraliev
    Edited by: Erlan Kadraliev on Feb 8, 2011 4:50 PM
    Edited by: Erlan Kadraliev on Feb 8, 2011 4:58 PM
    Edited by: Erlan Kadraliev on Feb 8, 2011 4:59 PM

    Hi Ethan Jewett 
    1. About %ENTITYSET% it is normal. Before this line  i write :
    *SELECT(%ENTITYSET%, "ENTITY", GROUPS, "[ID]=%GROUPS_SET%")
    So it is not this problem. %ENTITYSET% just parameter, that i used.
    2. Are you running the scripts using the same data manager package? I am running two different package for 2 different Script.
    For example aPackage for aScript, and bPackage for bScript.
    My questions was how can i send parametr from one script to another, for example i can run another script by using BADi command Runlogic, but how can send parameter that i need to used on another script. I have for example parameter %GROUPS_SET% (CG001) on aScript, but i can't get this parameter on another script, if i write %GROUPS_SET% i will get error  ("GROUPSDATAVALUE" is not assigned to the Data Administrator)
    OR
    Maybe if you will answer for next question, i will be able solve problem , How can i send parameter CG001 (this is %GROUPS_SET%, for example it stay in EXCEL in cell A5) from excel to script logic by running package. Maybe i can get cell value on Dynamic Script Data Management?  
    My Dynamic Script on bPackage
    PROMPT(RADIOBUTTON,%CHECKLCK%,"u0412u044Bu0431u043Eu0440 u0431u0430u0437u043Eu0432u043Eu0433u043E u043Fu043Eu043Au0430u0437u0430u0442u0435u043Bu044F.",1,{"u0412u0441u0435u0433u043E u0410u043Au0442u0438u0432u044B","u0421u043Eu0431u0441u0442u0432u0435u043Du043Du044Bu0439 u043Au0430u043Fu0438u0442u0430u043B","u0412u044Bu0440u0443u0447u043Au0430 u043Eu0442 u0440u0435u0430u043Bu0438u0437u0430u0446u0438u0438","u0414u043Eu0445u043Eu0434 u0434u043E u043Du0430u043Bu043Eu0433u043Eu0431u043Bu0430u0436u0435u043Du0438u044F u043Eu0442 u043Fu0440u043Eu0434u043Eu043Bu0436u0430u044Eu0449u0435u0439 u0434u0435u044Fu0442u0435u043Bu044Cu043Du043Eu0441u0442u0438"},{"BPAST_ALL","BPEQ","BPPROCE","BPOPIN_GO"})
    INFO
    (%EQU%,=)
    INFO
    (%TAB%,;)
    TASK
    (/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)
    TASK
    (/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)
    TASK
    (/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)
    TASK
    (/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,CHECKLCK%EQU%%CHECKLCK%%TAB%)
    TASK
    (/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,MYTEST_145.LGF)
    Best Regards,
    Kadraliev Erlan

  • Script logic problem BPC 7.5

    Hi!
    We have a script logic that worked fine in BPC 5.1 but after our upgrade to BPC 7.5 it doesn´t work anymore.
    I will try to explain the part of or logic that doesn´t work anymore.
    We have 2 lines that will pass through the script, each line creates a temporary value  on KATEGORI ="#avskr1").
    Depending on the value created on  u201C#avskr1" it should do calculation A if the value is negative and calculation B if the value is positive. To do this we the following script logic:
    *WHEN GET(KATEGORI="#avskr1")
           *IS < 0
    *Calculation A
    ELS
    *Calculation B
    And this logic worked fine in BPC 5.1.
    If line X had -50 as a value in  u201C#avskr1"   and line Y had 75 as a value  in u201C#avskr1" , calculation A would be performed on line X and calculation B on line Y
    With the same example as above in BPC 7.5 calculation A will be performed on both lines.
    But if I change the logic to the following script logic in BPC 7.5:
    *WHEN GET(KATEGORI="#avskr1")
           *IS  = -50
    *Calculation A
    ELS
    *Calculation B
    Calculation A would be performed on line X and calculation B on line Y. It seems like the logic can´t handle <> signs in this script logic anymore.
    Regards
    Fredrik

    Hi!
    Unfortunately it didn´t help still the same error.
    And I just got an answer from SAP Support that there are a bug in the use of "Get whith When or lookup" in 7.5 SP03 which we currently are using, but it has been fixed in SP04. They just put up a SAP not 1515973 about the issue.
    Unfortunately they have no work around for this problem so I don´t know how to solve it untill we have installed SP04.
    Regards
    Fredrik

  • Flash CS4/AS3 - How to use a preloader with FLVs?

    Somehow I've had a really hard time finding a straightforward forum answer or tutorial for this--maybe someone can help?
    I have an SWF file that references/loads an external FLV file (www.44designs.com/promo_video.php), but since the FLV file is about 9MB and can take time to load on a slower connection, I think a preloader (something simple like "LOADING...100%") would be a good idea as the FLV loads.
    Anyone have a simple way to do this??  I've had no success in finding what I need--just scripts for loading SWFs.  You can see an example of this on www.44designs.com where a preloader script I've got seems to be referencing the SWF (thus loading almost immediately) instead of the much larger external FLV.  Make sense?  I'm not super AS3 savvy, but I can follow logic and cut and paste

    Great info, thanks for the post!

  • Fantom X6 with Logic Studio

    I have my Roland fantom x6 synth hooked to a midi interface, how do I access my sound inside the synth? Do I do this through logic by a patch script? How does this work?
    What is the easiest way?

    Nope - nothing to do with the Audio MIDI Setup utility.
    Assuming your Fantom is connected via MIDI, you need to tell Logic it exists.
    Load your default template, open the enivonment window, select a new environment layer, New -> Multiinstrument.
    Name is Fantom, enable all 16 parts by clicking on their little dashes on the object, and set it's parameters to the MIDI port the Fantom is connected on. Uncheck the icon checkbox. You might need to select the correct bank change format by double clicking on the multi and choosing the appropriate format (check your manual).
    You can also input patch names here, but I'd leave that for now.
    Close the environment window.
    Create a new arrange track, control-click on the track and choose Reassign track object -> and choose the "Fantom 1" which is MIDI channel 1 on your Fantom.
    Now notes you play are echoed out to the Fantom on channel 1, and you can sequence it. You can easily create tracks for the other MIDI channels if necessary in the same way.
    Once you've done this setup work, save it as your default template so your custom configuration is always available when you start a new song.
    Basically, all we are doing is creating a little virtual Fantom and telling Logic which MIDI port it's on, so we can assign it to arrange tracks and sequence it.

  • Assigning Keys to Apple Loops in Logic

    I am creating Apple Loops in Logic by selecting an audio region and then selecting "Add to Apple loops library" under the mini region menu.
    The manual states that whatever key I set in Global tracks is the key that is assigned to the loop. This works well for pitched material, but for non pitched material I don't want a key designated. I have noticed that when I set a tag to the loop of "Drums" no key is assigned, but when I set a tag of "Percussion" the key does get assigned to the particular loop. This is a problem because the pitch of the percussion changes when that Apple Loop is brought back into another Logic session that has a different key assignment the a particular loop on the Global Track.
    I understand I can designate "No Key" in the Apple Loops utility, but I prefer to make my loops straight from the Logic arrange window. I am finding the Apple Loops Utility a bit buggy. Does anyone know the most recent version of the Apple Loops Utility?
    Thank you for your help.

    Any word on a fix for this?
    I've found Apple Loops VERY buggy in L9! Not only do they not loop correctly in the browser when your project is at a sample rate other than 44.1 (for example, working for broadcast at 48k as I mostly do), but I've also seen them behaving weirdly in the arrange page.
    Today I had a truncated Apple Loop in a project which would play back differently on subsequent attempts. Sometimes it would get to bar 4, for example, and other times it would only get midway through bar 3...! And this is with basic Apple factory installed loops.
    What's up with this? I've already re-indexed and re-installed the loops. No change. No fix.
    Totally unprofessional, Apple.

Maybe you are looking for