Try to make a calculator using mxml and actionscript

I am a fresher for this. Trying to make a calculator application in flex but not sure about what logic to use. Also I am using a textarea field to display what user enters, however if user enters 1 and then enters 2 the number 1 is replaced by number 2. What should I do 
sso that the textArea field display all numbers that I enter and do not overwrite them? Please help on this. I have pasted the code that I am trying to write.

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"> <mx:Panel x="754" y="162" width="250" height="337" layout="absolute"> <mx:TextInput x="35" y="-30" id="displaytext"/> <mx:TextInput x="10" y="10" width="210" height="32" id="display"/>  <mx:Script> <![CDATA[ import mx.controls.Alert;  public function myEnterOne():void { var temp:String="One"; var tempOne=int(temp); tempOne=1; display.text=tempOne; }  public function myEnterTwo():void { var temp:String="two"; var tempTwo=int(temp); tempTwo=2; display.text=tempTwo; }  public function myReset():void { display.text=""; }  ]]> </mx:Script>  <mx:Button x="10" y="59" width="64.5" label="1" id="one" click="myEnterOne()"/> <mx:Button x="82" y="59" width="62" label="2" id="two" click="myEnterTwo()"/> <mx:Button x="155" y="59" width="65" label="3" id="three"/> <mx:Button x="10" y="101" width="64.5" label="4" id="four"/> <mx:Button x="82.5" y="101" width="64.5" label="5" id="five"/> <mx:Button x="155" y="101" width="65" label="6" id="six"/> <mx:Button x="10" y="142" width="64.5" label="7" id="seven"/> <mx:Button x="82.5" y="142" width="64.5" label="8" id="eight"/> <mx:Button x="155" y="142" width="65" label="9" id="nine"/> <mx:Button x="10" y="181" width="64.5" label="+"/> <mx:Button x="82.5" y="181" width="64.5" label="0"/> <mx:Button x="155" y="181" width="65" label="-"/> <mx:Button x="10" y="226" width="64.5" label="/"/> <mx:Button x="82.5" y="226" width="64.5" label="%"/> <mx:Button x="155" y="226" width="65" label="*"/> <mx:Button x="10" y="265" label="RESET" click="myReset()"/> <mx:Button x="82.5" y="265" label="ENTER" click="init()"/> <mx:Button x="155" y="265" label="Button"/> </mx:Panel> </mx:Application>

Try to change it for each user based on the Manager of numbers:

{var temp: String = "One";}

var tempOne = int (temp);

tempOne = 1;

Display.Text = Display.Text + tempOne; }

Tags: Flex

Similar Questions

  • Very new to photoshop, I try to make changes to a photo and set up as a dynamic object, but after the selection of dynamic object, the grid appears and my photo dissppears

    Very new to photoshop, I try to make changes to a photo and set up as a dynamic object, but after the selection of dynamic object, the grid appears and my photo dissppears

    Well, something's wrong with Photoshop. Try to close Photoshop, and then press Command + Option + shift as you restart Photoshop. You will be asked to clear the Photoshop preferences. ATTENTION: you will lose all current preferences.

  • When I make a video using CC and try to import a piece of music I get the response "could not complete your request because DynamicLink is not available.

    When I do a video using CC and try to import a piece of music I get the response "Could not complete your request because DynamicLink is not available" - any ideas please?

    Could not complete your request because the DynamicLink media server is not available. | Error postal codes of Mylenium

    Mylenium

  • I make several clips using audio and animation of scenario Photoshop CC.

    Each clip made a separate PCs, sound and animation and is rendered as MPEG4. But sometimes the AUDIO is not played on another PC and it is sometimes.  Is there a problem of "setting" of the clip?  Link or embed?

    All are produced in the same way.

    Video and audio each has its own codec. So, each computer must have the same codec so that he knows how to unpack the file. It is important to use a codec that should be on all computers, or provide a link so that the user can install the codec.

  • you try to upload the photo using facebook and email?

    Hi, I have listened to instructions on photoshop elements 11 but when I tried facebook upload button did not? I have sign up

    also when I tried to email I couldn't have my address where mistaken. This is all new to me.

    Thanks for any help

    Thanks again it would be something that I was missing!

  • Components, MXML and ActionScript Classes

    Hello

    I'm fairly new to Flex and OOP and confused on the operation of parts of OOP.

    I have an of Spark TextInput component with an id that corresponds to 'test '.

    I have also a function that takes "test.text", adds a string to and and puts the resulting value in an another TestInput called test2.

    How can I move the "appendPhrase()" function in a class so that she would always accept the values of 'test' and change the values of 'text2' ?

    I tried to create a function that would assign the value of the variable in the class with the name of classname.variable, rendering that can be linked and assigned

    the text value of the textinput that value, but I was wondering if there was another way I could do this?

    ~~~~~~~~~~~~~~~~Version1~~~~~~~~~~~~~~~~~~~~~

    < fx:Script >

    private function appendPhrase (): void

    {

    test2. Text = test.text + "has been added;

    }

    < / fx:Script >

    < XY = "0" s:TextInput = "0" id = "test" / >

    < s:TextInput x = "0" y = "10" id = "test2" / >

    < s:Button click = "appendPhrase (); "/ >

    ~~~~~~~~~~~~~~~~~~Version 2:~~~~~~~~~~~~~~~~~

    function of the class:

    public class ChangeString

    {

    [Bindable]

    public var: string text;

    private void appendPhrase(firstString:Object):void

    {

    text = firstString.text + "has been added;

    }

    }

    hand. MXML:

    [Bindable]

    public var changed: Object = new ChangeString();

    < XY = "0" s:TextInput = "0" id = "test" click = "changeValue (test.text)" / > "

    < s:TextInput x = "0" y = "10" id = "test2" text = "{changed.text}" / >

    package models
    {
              [Bindable]
              public class MyViewModel
              {
                        public var text:String "Hello ";
    
                        public function appendText(t:String):String
                        {
                                  this.text = this.text + t;
                                  return this.text;
                        }
              }
    }
    
    import templates. MyViewModel;
    [Bindable]
    public var model: MyViewModel = new MyViewModel();
    ]]>

    Maybe just a little differently, I would go to this topic. I use the model as a data carrier class and use a private local method, a utility or the class of controller class to change the values of the model (data carrier class).

  • How add/edit/remove UI Components (i.e. not text values) in a UIContainer according to the XML data by using mxml.

    Hi all

    Asked me to make a request to monitor a remote and data devices are accessed through XMLSocket, devices of remote system could be added/removed during execution. and the user Web interface must act accotdingly. What is the best way to approach to apply it? is it by using the mxml or action script? I've already implemented using mxml and may display devices in the Web for addiotion/deleting/editing dynamics of devices and its properties, I am looking for your input/suggestion.

    Thanks in advance.

    Hi Anthony,.

    Set unique name to each of the UIComponents added to the container (default stage)

    by using the name property of the components , you can get the object from the container to aid

    container.getChildByName ("name assigned to the property") , this function will return as DisplayObject

    The DisplayObject instance to the target conversion type for the class that you can Edit the object.

    example:

    var sp:Sprite = myContainer.getChildByName ("one") as Sprite;   Here I am reference sprite with the name "a" to "myContainer".

    SP.x = SP.x + 10;  Here I am to change the property 'x' of the Sprite whose name is 'a '.

    Note: Similarly, you can perform any operation on the sprite

    Removal of UIComponent:

    removeChild will serve to remove the child from the container where it is added

    container. removeChild (container.getChildByName ("assigned to the property name"));

    If this post answers your question or assistance, please mark it as such

  • Using webServices and Interactive instruction

    I would like to know how can I know how to create an Interactive instruction that uses a Web service.

    I can't find anything useful about it on the internet or official documentation...

    Any help?

    Kind regards!

    It is the same whether inside a statement Interactive or not, the use of a Web service in Flex:

    Step 1. Find a Web service that you want to use.

    (Here's a link public wsdl for test/proof of concept: http://www.webservicex.net/WeatherForecast.asmx?WSDL )

    Step 2. Use, as shown in this example: http://www.cflex.net/showFileDetails.cfm?ObjectID=582

    More information on how to use the Flex webservices:

    This http://TV.adobe.com/watch/Flex-in-a-Week-Day-2/Retrieving-and-Handling-Data-using-webservi.

    http://blogs.4Point.com/Brad.White/2008/12/4-ways-to-invoke-a-WebService-in-Flex-with-MXML - and - actionscript.html

    class ebservice http://blog.flexexamples.com/2008/04/14/Calling-a-simple-Web-service-from-Flex-using-the-w.

    It will be useful,

    Oana

  • I use Windows Movie Maker on Windows 8 computer and when I put in a video and you try to look at it, it appears black with no audio signal. How can I fix it?

    I use Windows Movie Maker on Windows 8 computer and when I put in a video and you try to look at it, it appears black with no audio signal. How can I fix it?

    Hi Michael,

    Thanks for posting your query on the Microsoft Community.

    Because the problem is specific to a particular video file or all the files?

     

    Follow the methods and check them off below if it helps:

    Method 1: Reset the Windows movie maker for default settings and check.
    To restore the default settings

    1. click on Toolsand then click Options.
    2. click on the tab that you want to reset the settings and then click on the default settings.

    Method 2: I suggest you run the audio Troubleshooter and check if it helps:

    http://Windows.Microsoft.com/en-us/Windows/no-sound-help#no-sound=Windows-8&V1H=win8tab3&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Method 3: repair of Director and check

    Follow the link as reference below:

    https://support.Microsoft.com/en-us/mats/video_freezes_or_crashes

    Hope this information is useful.

    Thank you.

  • When I make a selection using the lasso and try to copy the selection, nothing is copied.  Why?

    I have PhotoShop CS6 for Mac, version 13.0.6.  When I make a selection using the lasso (or any other selection tool) and select 'Copy' and try to move the selection copied, nothing is copied.  What is going on?  I can't find an answer in my search for Abobe PS or the Web site, in general.

    If you still use the selection tools when you try to move the contents of a selection, it will simply move the selection. If you want to move the content, use the tool move (but be aware that the default action is to cut; use Opt (Alt on Windows) to copy the selection by dragging).

  • Preferance pane window keeps popping open when the data entry or search in all fields. I'm also using 1Password and happens when you try to enter a password

    I'm running on Mac OS X 10.7.4, Firefox 14.0.1. This problem did not exist until this last update of Firefox. Basically, a preferences panel opens each time data is entered in a field. It doesn't seem to be the same preferences panel you see when you open preferences through normal access Firefox, IE. Firefox > Preferences. All the choices listed in this special preference pane are specific to Firefox. I have a screenshot that I could include if wanted. When you use the pane appears when you enter a search in the search bar near the address bar of 1Password the task pane opens, when entering data in any field because I am now filling in this report in detail pane also appears. It's pretty boring. Any advice? I will try systematically to leave any add-ons and see if that makes a difference. I have ave tried to do a reinstall without result.

    Isn't it always the case if you disable the other extension except 1Password?

    Start Firefox in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

    If this does not work in mode without failure, then disable all extensions and then try to find out who is the cause by allowing both the problem reappears.

    • Choose "Disable all add-ons" on the Safe Mode to set window to disable all extensions.
    • Close and restart Firefox after each change through "file > exit ' (Mac: ' Firefox > leave";) Linux: "file > exit ')
  • My destop all icons are colored and when I try to make crystal or visible, I can't change

    My destop all icons are colored and when I try to make it transparent or visible, I can't change

    Click the Start button, select Control Panel

    Check points: -.
    1. in the performance and Maintenance/adjust Visual effects or if you use the classic theme - settings/system/advanced/performance
    'Use the shadows of the desktop icon labels -' must be checked
    2. right click on the desktop, point to arrange icons by and ensure that items Web Lock on Desktop is unchecked;
    3. If you have content web on your desktop, transparency does not do a right click on the desktop. Select properties, then go to the Desktop tab.
    Click on the button customize the desktop, and then open the Web tab.
    Uncheck everything in the box of Web Pages
    Press OK, then apply and OK again.
    4. you can't have a file html as wallpaper, it must be an image file.
    It is sometimes necessary to restart to take effect, sign out and then sign back in.

  • Apple TV (4th Gen) ~ try to use Siri and instead of answers, it scrolls the suggestions of things I could say.  What happens and how can I cope?

    Apple TV (4th Gen) ~ try to use Siri and instead of answers, it scrolls the suggestions of things I could say.

    What happens and how can I cope?

    Have you actually enabled Siri in settings > general > Siri, or are you just using the Siri button on the remote control?

  • I wish I could make a website I use ofter and drop it on the screen of firefox under url. Then, I'll have rapid access. How can I do this?

    Question
    I wish I could make a website I use ofter and drop it on the screen of firefox under url. Then, I'll have rapid access. How can I do this? I currently use it on my laptop, but recently bought a new computer and downloaded firefox and lost a lot of features that I enjoyed.

    It was exactly what I was looking for - thanks a lot!

  • How can I make the best use of a new external hard drive and a new catalog full of photos just loaded into Photoshop elements 14 Organizer?

    How can I make the best use of a new external hard drive and a new catalog full of photos just loaded into Photoshop elements 14 Organizer?

    Keep all the files on external hard drive image?  Nothing else and no pictures on the desktop?

    Keep all image files both places?

    What is the best way to go through thousands of images in the Organizer to identify and place them in files?

    Once I've placed a file, I just leave it in the entire catalog or a way indicate to me that it has been sorted?

    As overwhelming, any tips/shortcuts/schemes, you can offer are welcome!

    As I only have the version of the EP, here is some info on the organiser:

    https://helpx.Adobe.com/Photoshop-elements/how-to/use-elements-Organizer.html

    Independent of how this feature works, you want to have your photos in one place and have a backup (second copy) somewhere else. All hard drives will not be successful at some point - some more early, some late - never trust to have your files in any safety devices if they are on a single disc. Once you have your sorted, it would be useful that you will organize/name/tag new photos immediately if the task is relatively short and simple. I copy my photos on my internal hard drive for my camera, take a quick look with preview to see who needs some changes and then decide where to put them - either drop them immediately after naming them or bring in an editing application and then file them away.

Maybe you are looking for

  • JavaScript code doesn't work not properly in version 7

    I have a Web site that works very well with the version 3.6.9, now it does not work properly with version 7. My files containing javascript, links in the codes codes are broken when register some controls using the < % @ Register... / > tag.for examp

  • How to set the cursor in the text of a message response

    I use TestStand 4.1.1. During testing, I need to analyze some data of the operator. I use a popup message with the response enabled text box. My problem is that the cursor does not automatically appear in the running text box. I don't want to have to

  • Windows Update problem: Code 8000FFFF

    Server OS - Windows 2008 R2 Error in Event Viewer: Log name: SystemSource: Microsoft-Windows-maintenanceDate: 2010-01-06 12:54:39Event ID: 4375Task category: noLevel: errorKeywords: ClassicUser: SYSTEMComputer: MALACHITE.corp.xpsystems.comDescription

  • EA6300 with a XAC1900 wireless bridge

    Is it possible for a bridge with a XAC1900 wireless EA6300.

  • Useless update message

    HP 6710 b with Win7-32.  Every so often, I get a notice in the lower right of my screen that an update is available and I want to download it.  There is no button on the notice to say yes or no.  My only option is to go into the Task Manager and dele