passing variables with "ProgressEvent.PROGRESS.

Hi all, I have this code:

imgContainer.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, function() {loadProgress (charger)});

function loadProgress (aa): void {}

var percentLoaded:Number = Math.round ((event.bytesLoaded/event.bytesTotal) * 100);

trace ("loading:" + percentLoaded + "%");

percentCar = percentLoaded * 3;

AA. Width = percentCar;

AA.x =-percentCar/2;

}

but does not work because of the way in loadProgress no event is to calculate bytesLoaded ecc...

How can I pass variables in this formula?

Thank you very much

use:

imgContainer.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress);

function loadProgress(event:ProgressEvent):void {}

var percentLoaded:Number = Math.round ((event.bytesLoaded/event.bytesTotal) * 100);

trace ("loading:" + percentLoaded + "%");

percentCar = percentLoaded * 3;

Loader.Width = percentCar;

Loader.x =-percentCar/2;

}

or, if there is a really good reason to spend charger in your use of function loadProgress:

imgContainer.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, {function (e:ProgressEvent)}

loadProgress (e, loader)

});

Tags: Adobe Animate

Similar Questions

  • Passing variables with loadMovie

    I'm new to ActionScripting. I want to pass the value of a variable from a swf file to another. I have a tutorial book that says I can do this with the loadMovie action when I load the second film; However, it only gives me no indication in how to use loadMovie to pass the value of the variable. Any suggestions would be greatly appreciated. Ray

    loadMovie is puny and weak - using the MovieClipLoader class. You can then use
    the onLoadInit method - when it fires you have a reference to the load
    target and can define a variable it, call a function in, etc...
    Search using MovieClipLoader - and more specifically the onLoadInit
    method

    --
    Dave-
    Developer leader
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

  • READURL call on Macintosh, will not pass variables with spaces?

    Here is my code and the problem. I'm trying to pass a tablename and a class with READURL name and the PHP script takes the news and returns me my classid. It works perfectly on the PC, but on a MAC, when I click on a name of class with a space I retrieve an empty string as the value of my back... Here's my code for AW and PHP... If you can help I would be grateful readlly.

    http do not have spaces in the URL.

    This by clicking on a class name - what happens on a web page, or AW?
    Whatever it is, you should urlencode the link. Replace all the spaces in the URL
    with + signs, either manually on a web page, or by using replace it
    function in AW [replace ("", "+", String)]. Then, in your PHP script, you can
    changing the assignment of _classname $ to include urldecode:

    $_classname = urldecode($_GET["classname"]);

    This should return multiple word format.

    --
    _______________________

    Paul Swanson
    Portland, Oregon, United States
    _______________________

    "bradsteele" wrote in message
    News:e3o1ja$9gn$1@forums. Macromedia.com...
    > Here is my code and the problem. I'm trying to pass a tablename and one
    > classname with READURL and the PHP script takes the news and get back to me
    my
    > classid. It works perfectly on the PC, but on the MAC, when I click on
    on one
    > classname with a space I retrieve an empty string as my return
    value... Here's
    > my AW and PHP code... If you can help I would appreciate readlly
    it.
    >
    >
    >
    > getClassID.php code...
    >
    ><>
    >
    > / / DO THE NON_CACHEABLE SCRIPT
    > header ("Expires: Thursday, July 26, 1990 05:00:00 GMT");
    > header ("Last-Modified:".) gmdate ("D, d M Y à", time() + 300). "
    "" "GMT");
    > header ("Cache-Control: must-revalidate, non-cache");
    > header ("Pragma: non-cache" "");
    >
    > / / DEFINE VARIABLES
    > _table $ = $_GET ['table']. "_classes;
    > $_classname = $_GET ['classname'];
    >
    > / / CONNECT TO THE DATABASE
    > mysql_connect ("localhost", "user", "user") or die ("unable to connect to")
    DB! ») ;
    > @mysql_select_db ("trek") or die ("cannot select DB!");
    >
    > / / GET THE CLASS ID
    > $sql = "SELECT classid OF ' $_table" where classname = "$_classname" ";
    > $r = mysql_query ($sql);
    >
    > / / IF MORE THAN 1 ROW, THEN PRINTING WRONG (ERROR)
    >
    {> while ($row = {mysql_fetch_assoc ($r))}
    > $query = $row ["classid"]; }
    > print $query;
    > ?>
    >
    >
    > AUTHORWARE 7.02 CODE BELOW:
    >
    > - Get class ID
    > If NetConnected then
    > www_action: = '? action = getData.
    > www_query: = "& table =' ^ tablePrefix ^"& classname ="^"
    LowerCase (ClassName)
    > www_URLString: = NetLocation ^ 'getClassID.php' ^ www_action ^.
    www_query
    > www_ClassID: = ReadURL (www_URLString, 10)
    > end if
    >

  • AppleScript find and pass variables with a single value for the new string

    Hello again,

    I need a solution to do this:

    We have the string

    {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "} (a few example of result window)

    This is a Pixel data - x, y and RGB as a text

    How can we separate it into different channels organized by RGB, to create something like

    {'109 50 58', 6.0 7.0}

    {'62 21 37', 0,0,1,0}

    {"108 50 56", 2,0,4,0}

    and etc.

    Thank you

    Try using:

    the_string value {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "}

    Set new_strings to {}

    Repeat with 3 to (count elements of the_string) by 3 this_item

    Set temp_list to {}

    If the element the the_string this_item is not in temp_list then temp_list temp_list this_item & point of the_string

    Repeat with this_list_item points of temp_list

    the value new_strings new_strings & (this_list_item as a list)

    end repeat

    Repeat with this_list from 1 to (account new_strings)

    If (this_list point new_strings as String) is point of the_string this_item then

    point Set this_list to {this_list point of new_strings} new_strings & elements (this_item - 1) at (this_item - 2) of the_string

    end if

    end repeat

    end repeat

    Repeat with 1 to (count elements of new_strings) this_list_1

    Repeat with this_list_2 (this_list_1 + 1) (count new_strings elements)

    If this_list_1 point new_strings is not {} and this_list_2 point new_strings is not {}, then

    If the item 1 of article this_list_1 of the new_strings is point 1 of article this_list_2 of the new_strings then

    point Set this_list_1 of new_strings to the point of new_strings this_list_1 & (items 2-3 (point get new_strings this_list_2))

    this_list_2 point new_strings value {}

    output of repetition

    end if

    end if

    end repeat

    end repeat

    Set result_string to {}

    Repeat with this_string in new_strings

    If this_string is not {}, and then assign result_string result_string & this_string

    end repeat

    (143290)

  • Download DataServer User/Pass/host with ODI Variable to use in the ODI tools

    Hi guys.


    I was thinking about a way to dynamically modify the ODI tool based on the parameters of a root.


    So I created a dummy DataServer with host that the IP address of the server I want to reach and define the user/pass I will use to authenticate.


    Data_Server_DMZ.png

    Then I coded a variable with odiRef.getInfo to obtain this information, but the two results return nothing because this API based on the execution of an interface works. I've not found an API to get these values from a package.

    ODIVariable_HOST.png

    Is there a way to get this base only in a logical schema, such as: odiRef.getDataServerInfo ("LS_OF_THE_DATASERVER", "DSERV_NAME") so that I can use it like this:

    ODI_PKG.png

    Thanks for the help, Giampaoli.

    I've made a few changes based on the post you sent.

    Basically, I used only the tip of the game from the source as the topology I wanted settings and coded the target with this:

    Command on the target

    Command on the Source

  • Passing variables between LabVIEW and TestStand

    Hello

    I'm just learning how to use TestStand and although there are a multitude of resources available, I always find me at a loss on how to pass variables between TS and LV, leaving me to think that there is one fundamental thing that I'm missing which is likely, given that I have a weeks experience with LabVIEW and a days of experience with TestStand.

    I took a glance to the example of 'Clusters' to the Code Modules in TestStand examples (I use TS 2016 if it matters) because I thought it would be quite ideal for what I hope. In this case, I hope to be able to pass a string (a file path) to LabVIEW and VI power take this string and use it as part of an order for the Exec.VI system.  Then, I would be able to pass strings back to TestStand to show the user if an error occurred, but I thought I should get the first part of work.

    I guess my question is what do I have to wait to see in clusters to the example of the Modules of Code? The Watch window displays all defined variables premise on which has the ContainerOut in the Variables pane, but I don't see any kind of update on facades (VI1.vi and VI2.vi) LabVIEW code. Should I be?

    I looked at a few other discussions of the forum here and here, as well as the document of the basis of knowledge here, but could not recreate their solutions. It seems that the connector pane would be a viable way to go, but I'm not sure on how we create and use effectively. According to this document , it makes it seem like it should be simple enough to makes these terminals, but I am still missing a key step. I was able to follow all the steps on the knowledge base document and run the sequence, but then had no idea if it worked or not; I have the report show me the values of the variables I put, but I have no idea whether or not he actually did anything with the LabVIEW VI, or how I could see that.

    Please let me know if you need further information or clarifaction everything I ask.

    Thank you for your time,
    JColvin

    Digilent, a company of National Instruments

    If you want to enter values, you must create a vi for instance dialog box

    The OK button will allow new values to pass to the output terminals.

    A Cancel button will pass just the original through the output values without alteration. The VI will close when either the OK button or cancel were pressed.

    Concerning

    Ray

  • Value of Variable with OracleDiagent throwing error in white

    Hi all

    In my process I use 3 variables as input #GL_Product_code, #GL_Period_no, #GL_Year, on this basis, I need to get all the details, if I gave the white input from of the two other entries value must extract the value below in the code where condition
    .. .or product_code = nvl('#GL_Product_code',product_code) and period_no = nvl('#GL_Period_no',period_no) and year = nvl('#GL_Year',year)

    but when I use local agent my process of execution with errors, when I execution of his mistake to launch as variable with OracleDiagent has no value

    Error details

    oracle.odi.core.exception.OdiRuntimeException: java.lang.Exception: ODI-17506: Variable has no value: GL_VALIDATE.GL_PERIOD_NO

    Thanks for your suggestion...

    Published by: 981371 on February 11, 2013 09:53

    Published by: 981371 on February 12, 2013 02:28

    Published by: 981371 on February 12, 2013 22:10

    Give a default value for this variable as 'IS NULL' or 'IS NOT NULL' somethhing to be replaced if you don't pass any value then runt.

    Chantal
    http://dwteam.in

  • variable with sql reuse various clauses

    Hello

    Is it possible to reuse the same variable with sql different queries in the packages...

    Example:

    I have a Word to say variable

    name of the variable 1): filename

    (2) in variable query: select 'emp.txt' of the double

    so using the name of this variable in the data store, I'm passing filename dynamically, but I need to change the file name to dept.txt emp.txt missing emp.txt food.

    A solution on my side uses a table dump with the file name. more without the use of db tables

    Please share views

    See you soon,.
    Surya

    You will then need the help of beanshell java technology. Variable2 take the second query in cooling mode. Now, create a procedure. At the 1st step of technology will be java beanshell with below codes.

    <>
    String xtr = "#variable2";
    @>

    Now in ko-> step use variable1 in assign mode

    Variable1 =<@=xtr@>

    It will certainly work.

    Thank you.

  • How to pass variables by using the command line when starting from a native application ActionScript

    How to pass in variables or arguments to start using the command line when starting a native ActionScript application? For example, I have my app MySweetWidget call and it was compiled with Adobe AIR runtime in captivity so now I have MySweetWidget.exe.

    In the command line, I call MySweetWidget.exe and would like to pass in variables or properties of the application. I guess that these variables are read from the loaderInfo.parameters object.

    Please let me know if the Adobe AIR runtime supports passing the parameters to native execution. If so, I would like to help determine the correct format of how pass variables. So would you want to read those loaderinfo.parameters object?

    Thank you

    Jeff

    I found the answer to my own question:

    Yes, it's a feature supported. It is documented on the following page:

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/desktop/NativeApp lication.html #event:invoke

    When you subscribe to the event from the NativeApplication invoke it will subsequently send the event and you read the table of e.arguments object to get the start in the native application arguments.

  • pass variables between classes

    Hello! I'm new to flash actionscript and I make a small game right now. I thought to create separate movieclips for each level of play and their assigned separate classes is cleaner and easier to code.

    for example: -.

    level 1 - level1.as

    level 2 - level2.as

    Level3 - level3.as

    My problem is how to pass variables (such as health, score, etc.) to a higher level?

    Please help I'm stuck on this and I have searched a lot but couldn't get the right answer...

    Oh, and I use cs3 flash with actionscript 3.0

    I don't think you really understand what are classes and movieclips.

    MovieClips are display objects; your character, the enemy, elements, platforms< these="" will="" be="">

    Classes can be used to define new elements or extend those which already exist, such as an object or a MovieClip.

    For the purposes of making a game, I would separate levels of executives.

    do level 1 on a frame labeled "level 1".

    and level 2 on a frame labeled "level 2".

    variables will carry an image to the image.

    Use gotoAndStop (frame_label) to switch between levels

    * Make sure you use stop(); on the first image to prevent bike between the frames.

    * You can make the frames between each level that has the code "gotoAndStop(previous level)" to prevent people to hit 'play' on the swf file and the cycling through your levels.

    You can also search for SharedObjects as a method of storage of variables even after that the swf file is closed.

  • Passing variables ActionScript 2 using javascript

    Hello

    I tried to pass variables to a flashdrive with on the page refreshes. In doing my research I fell I cross things like externalinterface and others.

    I found a javascript + actionscript who spent ariables flashing without updating the code page:

    I have therefore 8 flash with actionscript 2.0.

    HTML:

    <SCRIPT LANGUAGE=JavaScript>

    <!--

    function callJavascript() {}

    Mathias var = inputValue.vars.value

    window.document.myMovie.SetVariable ("testValue", Mathias);

    }

    ->

    < /SCRIPT>

    <object classid=' clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 ' codebase="""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8, 0,0,0" " " width="550" height="100" id="myMovie" align="middle"> "

    <param name="allowScriptAccess" value="sameDomain" />

    <param name="movie" value="setplay.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffcc00" /><embed src="setplay.swf" quality="high" bgcolor="#ffcc00" width="550" height="100" name="myMovie" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </body>
    <p>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value="Pass the variable to Flash" onClick="callJavascript()">
    <form name="inputValue">

    <a href="javascript:callJavascript()"> flash one</a><input type="hidden" name="vars" value="1.flv"/>
      </form>
    </html>

    I have a flash drive with a movie player instance name of myVid:

    ActionScript:

    var testValue:String = "";

    watchCallback = function (id, oldval, newval): String {}

    result_txt. Text = newval;

    myVid.play (newval);

    return newval;

    };

    _root. Watch ("testValue", watchCallback);

    The code gets the variable var in the html page. Pass vars to actionscript using javascript, displays text on result_txt and play flv video with similar name to a variable passed.

    The problem is:

    I have several a href links that I would like to have the different variables that they would pass to the flash drive.

    < a href = "javascript:callJavascript ()" > flash < /a > < input type = "hidden" name = "var1" value = "1.flv" / >

    < a href = "javascript:callJavascript ()" > flash two < /a > < input type = "hidden" name = "var2" value = "2.flv" / >

    < a href = "javascript:callJavascript ()" > flash three < /a > < input type = "hidden" name = "var3" value = "3.flv" / >

    < a href = "javascript:callJavascript ()" > flash four < /a > < input type = "hidden" name = "var4" value = "4.flv" / >

    How can I change the code so that if someone clicks on a flash of the value of var1 is passed to flash.

    and if two flash is clicked var2 are passed to Flash.

    Thank you.

    http://circlecube.com/2008/02/ActionScript-JavaScript-communication/

  • Passing variable of a function

    How to pass variable mulitple of a function using AS3? What this has to do with a class?

    It must be something simple that I'm missing. Please take a look and see what it could be.

    example:

    var endValue;  variable, I want to fill

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, dataLoaded);

    var request: URLRequest = new URLRequest ("population.csv");
    Loader.Load (request);

    function dataLoaded(evt:Event):void {}
    var myData:Array = loader.data.split(",");
    endValue = myData [0];

    }
    trace (EndValue);  undefined

    Thank you

    Sky

    read my message above.

  • Need to pass variable SWF * to * HTML

    Hi all, brand new to Flash and I'm used to working with a model Flash written earlier. In this model, there is a search box. My goal is to get some someone puts in this little white search box on my Coldfusion page for further processing. I want it because I know nothing of Flash (yet) and want the variable I need to work with to leave Flash quickly as possible so that I can use it in Coldfusion where I am comfortable on a deadline.

    Here is the code that I have which produces at least a promising URL in the browser. After a lot Googlin' I managed to set it up:

    on (release) {}
    Search = this. SomeName.Search; <-THIS SHOULD BE MY VARIABLE of RESEARCH
    getURL (" http://www.test.com/web/search.cfm", "_top", "GET");
    }

    In the browser URL, which in fact produces:

    http://www.test.com/Web/search.cfm?search=

    .. What seems promising. But notice, the SEARCH variable is empty.

    I need it as well as the SEARCH comes back equal to what I put in the white search box bit.

    Thus, for example, I need to go out like that (if I were looking for the word 'Cats'):

    http://www.test.com/Web/search.cfm?search=cats

    Once it's there, it's elementary to enter me the URL and work with it in Coldfusion.

    I've tried everything. Google is full of people trying to pass variable * in * SWF in HTML, but not the reverse. At least what I can say.

    Anyone have any ideas? Thank you!

    Dave

    That proved to be the answer of $ 1 million. I came back to report when I read your explanation which reads verbatim what it is and how to solve it. I didn't know there was a tool to help establish a path within Flash, however, it's cool.

    My Coldfusion page now treats this Flash thing search requests with happiness.

    That I was (and still am) lack of understanding as a beginner, how to communicate the different parts of a flash project. Layers? Calendar? PUH-lease. I have trouble with Javascript and never even touched C, which are both the syntax of Actionscript of Flash almost.

    Thanks for the reply! There are a few other homeless looking for this same answer so I hope that this Exchange winds in Google soon.

    Just to be complete on the subject, here's what the end result looks like on my end now (real URL disguised to protect development innocently):

  • Variable with nested function

    I create a button in a loop, which means that there is a button on each iteration. I pass variables to create and then I add a function to respond when clicked.

    Here's what the code looks like:
    button = _root.attachMovie (...);
    Button._x = xofs;
    Button._y = 200;
    ...

    button.onRelease = function() {}
    trace ("button clicked, make:" + report);
    };

    The problem is that when I test the movie, they always give the same url no wich mather a I click. The report variable is changing also to each iteration.

    The line
    trace ("button clicked, make:" + report);
    uses the value of "report" at the time when only it is run, it takes the last value assigned to 'report '. You will need to store the correct value with the MC:

    Button.Link = report;
    ...
    button.onRelease = function() {}
    trace ("button clicked, make:" + this.link);
    };

    or pass the variable "report" by value, using a function:

    function defineRelease (mc, url) {}
    mc.onRelease = function() {}
    trace ("url =" + url);
    }
    }
    in the loop:
    defineRelease (button, report);

    HTH,
    blemmo

  • Pass variables in OdiSqlUnload

    Hello

    I have an OdiSqlUnload in a package of ODI.

    I wish I could pass the user credentials and the JDBC URL from variables of refreshment. that is, I intend to store this information on a db table and retrieve it using Refresh variables, which are then used in the OdiSqlUnload, thus eliminating hard code them in my package.

    However, OdiSqlUnload dioesn can't seem to allow variables (I often use variables in Odisendmail by putting a "#" in front of the variable).

    Does anyone have a solution to work around this limitation.

    Here is the command I use:
    OdiSqlUnload «-FILE=/home/odi/RowCountReport.csv' "-DRIVER = oracle.jdbc.driver.OracleDriver" "-URL = #Get_URL ' '-USER = staging_odi" "-PASS = fDypcprs85Xi4oBeTRkc" "-FILE_FORMAT = VARIABLE" "-FIELD_SEP =," "-ROW_SEP = \r\n" "-DATE_FORMAT = YYYY/MM/DD hh: mm:" "-CHARSET_ENCODING = ISO8859_1" ""-XML_CHARSET_ENCODING = ISO-8859-1 "»
    Select * from < %=odiRef.getSchemaName ("BF_STAGING_AREA", "W") % >. ROW_COUNT_REPORT

    Where Get_URL is a variable refresh, being updated immediately before the odisqlunload step in my package.

    Thank you
    Tradtshirt

    Published by: tradtshirt on August 16, 2010 06:22

    The other way to use it is to call using the ODI procedure.
    Copy the code into the command on the target
    Mark as the Sunopsis API technology
    In the order on the Source - select the required Oracle technology and schema-
    Instead of the user and the password - use getInfo - <%=odiRef.getInfo("SRC_JAVA_DRIVER")%> so finall code should look something like this

    OdiSqlUnload «-FILE=/home/odi/RowCountReport.csv ' "-DRIVER = <%=odiRef.getInfo("SRC_JAVA_DRIVER")%>»» «"-URLSRC_JAVA_URL ' '-USER = SRC_USER_NAME" "-PASS = SRC_ENCODED_PASS '"-FILE_FORMAT = VARIABLE ""-FIELD_SEP =, ""-ROW_SEP = \r\n ""-DATE_FORMAT = YYYY/MM/DD hh: mm: ""-CHARSET_ENCODING = ISO8859_1 "" "-XML_CHARSET_ENCODING = ISO-8859-1"»
    Select * from< %="odiRef.getSchemaName" ("bf_staging_area",="" "w")="" %="" >.="">

    If incase you want to use this code with variable, use the name of the variable and call the procedure and variables in the package.

    Hope that helps. Please let me know if you need help.

    If you're not willing to try the method above, try givine variable with #PROJECT_CODE. VARIABLE_NAME syntax format.

    Published by: user13125360 on August 16, 2010 06:36

Maybe you are looking for