changing variables in the .as file

Hello.

I have a main.swf and the sub1.swf, the sub2.swf,... subN.swf files. They use all variables contained in the myCode.as file. Soum files... are loaded on clips of empty video on the main.swf.

The file myCode.as contains:

class myCode {}
var bReady1:Boolean = false;
var bReady2:Boolean = false;
...
var bReadyN:Boolean = false;
}

All files Soum... are:

var f_N:myCode = new myCode();
this.onEnterFrame = function () {}
If (f_N.bReadyN == true) {}
trace ("loan" + N);
f_N.bReadyN = false;
}
}

Finally, on the main.swf, I have a few buttons, each corresponding to a Soum file...

var f_main:myCode = new myCode();
this.btButtonSubN.onPress = function () {}
f_main.bReadyN = true;
}

So, the way I thought it would work was: I press the button. takes the bReadyN value 'true '. on the next onEnterFrame, subN.swf see bReadyN set to true and the string of traces. But I guess that is not the correct way to do it, f_main.bReadyN and f_N.bReadyN do not seem to see the same variable, and I don't know why. "Create" new variables? Any help is welcome, thanks in advance!

João

> "Create" new variables?
Not exactly, but close.
When you declare:
var bReady1:Boolean = false;
you create an instance property, which means that each instance of the class (object) has its own bReady1 property.

Depending on the situation, you can solve this problem by using a class property that is the same for each instance of the object:
private static var bReady1:Boolean = false;
Disadvantage: you cannot access an accessory static via a method, not directly, as you would in your delivery

Example code:

Tags: Adobe Animate

Similar Questions

  • How to assign a calculation to a variable in the RTF file?

    Hello


    I play a series of if - end if statements to calculate the "Days_Late."

    <? If: DAYS_LATE < 0? > <? xdoxslt:round ((somme (if: DAYS_LATE) div count (PAYMENT)), 0)? > <? end if? >

    <? If: DAYS_LATE = 0? > * <? end if? >

    <? If: DAYS_LATE > = 0? > <? xdoxslt:round ((somme (if: DAYS_LATE) div count (PAYMENT)), 0)? > <? end if? >

    I would like to assign the code above to a variable and use this variable in the following logic <? xdoxslt:IfElse (VARIABLE > 0, round (VARIABLE),-1 * round (xdoxslt:abs (VARIABLE)))? >

    to exercise a function of round_up ("symmetric" rounded). Oracle doesn't have a function for this yet...


    How can I make this work directly in the .rtf file?


    Thank you

    ATP

    Hi all

    I didn't change the data (sql).
    Also, I tried to make it work using the xdoxslt:set_variable () and xdoxslt:get_variable () functions. However, this was not necessary and makes more complex than required.

    It is now resolved using a formula of symmetric rounding (rounded to 0):

    I replaced the VARIABLE with my calculation: (sum (DAYS_LATE) count (PAYMENT) div)

    Thanks a lot for the replies and offers to help her

  • To access the Variables in the class file

    Say that I set a variable in a class file:

    public var container: sprite;

    I add the sprite to the scene and set it's x and y in the class file. How I would go about the change in x and y of the container in my fla file?

    You are welcome.

    using a method to expose parts of your class makes it easier to read and debug your classes.

    p.s. If your issue is resolved and that you are able, please mark this thread as answered.

  • Changing Variables in the Structure of the case?

    Hi all

    I have a box structure. Depending on whether the case is t/f I would change the value of two variables. If I put two variables in the real part of the strcture case that they may not be in the wrong part. How would assign values outside the structure of matter? Could I refer to the time of their numeorus in different cases? Thank you.

    So, something like that?

  • How can I change back to the original file icon?

    Hello

    Accidentally, I changed the icon of MIDI files, and I can't change it back. I tried to use the Folder Options, but it does not work. I tried to change file Associations, still no luck. The icon that I'm looking to take it is the original icon used for MIDI files, which is also the same for the video files, MP4 (not a screenshot). Is this icon in a specific file? I hope I don't have to do anything drastic, such as reinstalling Windows or do a system restore.
    Thank you for all the answers.
    ~ yosecchi1098

    Hello

    A couple of difficulty he 'solutions' for you to try. First of all, this: http://support.microsoft.com/mats/windows_media_player_diagnostic/ ; and the second one here: http://support.microsoft.com/mats/system_maintenance_for_windows/ .

    Let me know if one of those who solves the problem for you.

    Kind regards

    BearPup

  • How to change or update the host file?

    When I installed WIn7, I created a user account that is an administrator based on user account information.

    Now, I want to change the host file but it always respond that I have to use the administrator account to save the host file.  I tried to change the security in the prosperity of the host, but it does not allow me to do.

    Appreciate someone can walk me through step by step.

    Thank you very much

    Open Notepad as administrator (right click on the Notepad shortcut and choose "Run as Administrator") then open and edit the HOST file using this instance of Notepad.  (Via the menu "open file of-->".)

    Geographical area:

    C:\windows\system32\drivers\etc\

    or

    %SystemRoot%\system32\drivers\etc\

  • The variables in the local file backup

    Hello

    First of all, I'm not very good at that. I hope that you do not conclude against me. My player (projector, I guess that the term) runs on Windows XP using Flash 10 (I'm editing in CS5).

    I got the task to modify a Flash animation (not SA) so that it would collect data of WSDL, write to a text file, and then use that data every time it runs.

    You see, the Flash animation is part of a selection (digital display) and has a fixed term which does not network problems when retrieving WSDL data. So, while I managed to do work correctly in just showing the WSDL data directly - it sometimes expired.

    I have the recovery of WSDL part down (flex), I can even read .txt stuff files, but cannot make the middle part - written variables in a .txt file.

    I appreciate any help you can offer.

    You can perform manipulations of file with AIR. Otherwise, it is not possible for security reasons.

  • Cannot access the process value of the variable in the DXFA file

    Hello

    I use request-Assembly solution accelerator to sting the forms. I'm trying to access a process inside the dxfa file variable.

    It's the syntax I used: < var items = c:forEach = "${requestScope.paramsMap.templateList"templateItem"}" > the templateList value is not read. The same code works fine if I hard code elements.

    paramsMap is defined as the variable map of parameters in the function invokeODADocument.

    Any suggestions on what I might be missing here?

    Thank you.

    Kind regards

    Vidya

    Vidya Kesavan

    Just a shot in the water here, but I think you have a typo in on "requestScropt.paramsMap.templateList" where "paramsMap" should be "paramsmap" in the context of the CSC model. This could be the cause, it is impossible for ODA find the variable you are referencing. (I think it's "paramsmap" within the SCC regardless of what name you have the parameter map process variable.)

    Stefan

    Adobe Systems

  • load the e-mail address variable of the text file anyone?

    I have the code below, attached to a movieclip that I try to use to call for an email address of a text file. The idea is that the text file can be changed by a luddite, and the recipient's email address has changed in the flash file... but I do not too well...!

    The best I've done is undefined e-mail or garbage.

    any help gratefully received. Thank you.

    ___________________________________
    on {(overview)
    this.gotoAndPlay (2);
    }
    on (release) {}
    loadText = function() {}
    loadText = new LoadVars();
    loadText.load ("email.txt");
    loadText.onLoad = function() {}
    emailAddress = this.eAddress;
    }
    }
    submit.onRelease = function() {}
    getURL("mailto:"+emailAddress);
    }
    }
    on {(deployment)
    this.gotoAndPlay (1);

    Do not leave space before and after "=" symbol
    Here's the Simple function loading

  • How to write variables in the spreadsheet file

    I run an application in run in continuous mode.

    One of the variables change over time (it is inside a while loop and is part of the task of data acquisition). I want to record all the values this variable can take during execution and save them in a spreadsheet file?

    How this can be done?

    Give this example look on.  I am open a file before the beginning of my main loop and its closure after the main loop.  Inside the loop, I am formatting my data in a string of tabs.  I then save this string in the file.

  • Dumping Variables in the text file, separate from the TS report

    Hi all

    I know that I can probably do this in TestStand using LabView, however, which is not a luxury that I have.

    What I'm trying to do is, when a failure occurs, empty a specific set of information in a separate (probably text file) log file share the standard test report.  For example, I could be followed by some tampons or test State of the equipment in stationglobals, when a test fails, I want to empty the part of the overall station in a different newspaper, once again, apart from test report, is it possible?

    Looks like the closest thing to research through TS and the support forums, I found is to use ActiveX calls to maybe MS Word or Excel and generate something there?  I was expecting something a little simpler?

    Kind regards

    Mike

    Hi Mike,.

    Try this:

    Write, method

    Syntax

    PropertyObject. Write (pathchaine, objectName, RWoptions)

    Goal

    Writes the content of an object in the file specified by pathchaine and associate it with the name specified by ObjectName with the object in the file.

    Remarks

    If you call this method on an object alias, TestStand generates the stream using the object to which the alias refers. This method does not include the Subproperty alias objects in the stream. See IsAliasObject for more information on the alias objects.

    Parameters

    pathchaine String

    [In] Pass the path of the file to which to write the data of the object.

    objectName String

    [In] Pass the name to associate with the object.

    RWoptions Both

    [In] Pass 0 to specify the default behavior, or pass one or more constants of ReadWriteOptions . Use the bitwise OR operator to specify multiple read/write options.

    For example, to make a statement in a sequence with local variables, and run:

    Locals.Write (C:\\temp\\Locals.txt","Locals",0" ")

    This will generate a text file containing the values of the local variables. You can use it on any object, but you will probably need to ask with the options to get what you want.

    I hope this helps.

    -Jack

  • How to read a string of file &amp; assign val to a variable in the batch file

    Hello

    How to read a string from a file and assign the value to a variable, then return the value on the screen in the windows batch file?

    Any suggestions?

    Thank you.

    Try again with

    off @echo
    for /F "delims =" % in ('findstr /i OPEN status.log") set var = %% a
    % Var Echo%

  • Muse to "put" change content of the mucow file. Modification of HTML tags ' &lt; entry &gt; &lt; / input &gt; "becomes" &lt; entry... / &gt; '. browsers do not like that.

    Muse widget files (mucow) have exact desired html to include. It seems to do the data between tags that is ' < textarea... > enter data < / textarea > ' or < iframe... > < / iframe >.

    < iframe... > < div > < / div > < / iframe > is an autour work but gives bad results when used with other html tags. Muse 'place' truncates the closing token (i.e. < / iframe >). Is there a solution?

    Your mucow has some problems.

    (1) you're missing directive CDATA to prevent the XML parser to play with your HTML code.

    (2) the id of your text box must be in quotes.

    Here is a corrected version of your sample.

    http://musegrid-snap-widgets.BusinessCatalyst.com/dummy-HTML-page.html"label =" URL: "/ >

    ]]>

  • Changing Variables in the form of text display

    Hello

    I'm working on a game in Animate that lists multiple partitions at the same time - six, to be exact. There are six personalities in the game, and with the player's actions determine the positives or negatives displayed to each personality.

    The player is presented with a situation and effects of the action of their score with one or more of the personalities. I would like to know how to set a text field to change by a negative or positive value (not just by changing to a specific number), based on which button the player chooses. I created symbols for each of these six fields, each of them has a unique name within the symbol text field.

    Thanks for any help you can give!

    Hi Rob,

    Not a problem - look at this: https://dl.dropbox.com/u/109596236/score-keeper.zip

    Just ask if you have any questions,

    Joe

  • Variable in the target ODISQLUnload

    Hello

    I have a doubt. It is possible to use a variable in the target file path? It does not work.

    Capture.PNG

    Thnks

    Yes. You don't need the ampersand character simply rewrite like c:/Output/Employees/#GLOBAL.v_Today.txt

Maybe you are looking for