A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [RESOLVED] textbox not updating

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    13

    resolved [RESOLVED] textbox not updating

    Hi All,

    i have a dynamic textbox that its displaying the wrong value

    Code:
    Folds = 1;
    			tDev20F25 = Number(Size2.text) + Number(Sel1Fac0F25);
    			Dev2.text = tDev20F25.toFixed(3).toString();
    			trace("tDev20F25 "+tDev20F25);
    			trace("Number(Size2.text) "+Number(Size2.text));
    			trace("Number(Sel1Fac0F25) "+Number(Sel1Fac0F25));
    			trace("Dev2.text "+Dev2.text);
    			trace("tDev20F25.toFixed(3).toString() "+tDev20F25.toFixed(3).toString());
    instance Dev2 shows -5.316
    all trace entrys above show -2.655 which is correct

    before this script ran the value was -5.316

    any ideas?

  2. #2
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    fla is too big to attach

    cb are check boxes

    the error is when this is triggered by cb3 when cb4 is also checked
    if cb4 is not checked then the textbox updates fine

    Code:
    cb3.addEventListener(MouseEvent.CLICK, Checkboxhit);
    cb4.addEventListener(MouseEvent.CLICK, Checkboxhit);
    cb5.addEventListener(MouseEvent.CLICK, Checkboxhit);
    
    function Checkboxhit(event:MouseEvent):void { 
    	var cbox = event.currentTarget.name.slice(-1);
    	switch(cbox){
    		case "3":
    		if (cb3.selected == true){
    			Size3i.visible = true;
    			Size3.visible = true;
    			Dev3.visible = true;
    			ang2.visible = true;
    			Line4.visible = true;
    			cb4.visible = true;
    			TID4.visible = true;
    			Size3.tabIndex = 3;
    			Folds = 2;
    			ang2.dispatchEvent(new Event(Event.CHANGE));
    		}else{
    			Folds = 1;
    			tDev20F25 = Number(Size2.text) + Number(Sel1Fac0F25);
    			Dev2.text = tDev20F25.toFixed(3).toString();
    			trace("tDev20F25 "+tDev20F25);
    			trace("Number(Size2.text) "+Number(Size2.text));
    			trace("Number(Sel1Fac0F25) "+Number(Sel1Fac0F25));
    			trace("Dev2.text "+Dev2.text);
    			trace("tDev20F25.toFixed(3).toString() "+tDev20F25.toFixed(3).toString());
    			ang1.dispatchEvent(new Event(Event.CHANGE));
    			tDev30F25 = 0;
    			tDev40F25 = 0;
    			tDev50F25 = 0;
    			tDev60F25 = 0;
    			tDev70F25 = 0;
    			tDev80F25 = 0;
    			tDev90F25 = 0;
    			Size3i.visible = false;
    			Size3.visible = false;
    			Dev3.visible = false;
    			ang2.visible = false;
    			Line4.visible = false;
    			cb4.visible = false;
    			TID4.visible = false;
    			
    			if (cb4.selected == true){
    
    				cb4.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    			}else{
    				
    			}
    			
    		}
    		break;
    		case "4":
    		if (cb4.selected == true){
    			Size4i.visible = true;
    			Size4.visible = true;
    			Dev4.visible = true;
    			ang3.visible = true;
    			Line5.visible = true;
    			cb5.visible = true;
    			TID5.visible = true;
    			Size4.tabIndex = 4;
    			Folds = 3;
    			ang3.dispatchEvent(new Event(Event.CHANGE));
    		}else{
    			Size4i.visible = false;
    			Size4.visible = false;
    			Dev4.visible = false;
    			ang3.visible = false;
    			Line5.visible = false;
    			cb5.visible = false;
    			TID5.visible = false;
    			Folds = 2;
    			tDev40F25 = 0;
    			tDev50F25 = 0;
    			tDev60F25 = 0;
    			tDev70F25 = 0;
    			tDev80F25 = 0;
    			tDev90F25 = 0;
    			if (cb5.selected == true){
    				cb5.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    			}
    			ang2.dispatchEvent(new Event(Event.CHANGE));
    		}
    		break;
    		case "5":
    etc

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    13

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    It might be easier to see the *.fla than to go through that lot, if you can attach it and associated stuff (if any)

    or create a downloadable link

  5. #5
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    https://www.dropbox.com/s/xtzdq4fr8zb5rmh/fold.fla?dl=0

    frame 25 - actions layer

    thanks
    [edit]
    you may need the xml file (below) generated by "http://ts-server/WebBook/bend3xml.php"

    https://www.dropbox.com/s/4znes5hvafdogyx/xml.txt?dl=0
    [/edit]
    Last edited by Arcticwarrio; 01-21-2015 at 12:44 PM.

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    I didnt need the xml as I used my own server, I have no idea where to begin with your file, I'm not even sure what I should be doing with it.
    i enter a few numbers and thats it?

    None of the small combos have anything in them either ??

    When i test it flash it is full of errors too, perhaps you might want to import the xml locally for testing, rather than try to get it from the web from within flash, then do the online one.


    If you can explain where in the swf when you use it what is going on.

    Sorry
    Last edited by fruitbeard; 01-21-2015 at 01:27 PM.

  7. #7
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    Hi, the combo's are populated with the xml file.

    its generated by php from mysql.

    the whole swf works fine,

    except if you click (1 - 8 ) then click check boxes 3, 4, 3 you see the error. (4 appears when you check 3 )
    if you click check boxes 3, 4, 4, 3 there is no error.
    the trace lines display the correct numbers for both sequences the Dev2 text box shows -5.316 on screen but trace(Dev2.text); shows -2.655 on the 3 4 3 sequence

    FLA = https://www.dropbox.com/s/6chkvltzaqwdv0b/local.fla?dl=0
    XML = https://www.dropbox.com/s/sqjcqz9kt2gmpyv/fold.xml?dl=0

  8. #8
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    P.S. its for developing lengths for folding metal.
    if you click on the numbered buttons, the numbers are how many folds are required.

    ie click the 2 in the U shape:
    the 3 red boxes are looking for millimeters say 50, 100, 50 would make a channel 100mm with with 50mm "legs"
    the "in" boxes are for converting from inches, the numbers above those are the minimum sizes the machine can handle
    with the selected parameters.
    the default parameter setting when loading that screen is 3mm thick mild steel bent to 90 degrees using a 20mm wide tool.
    its bend deduction for that set up is -2.655mm per corner, ( deducted once for the sides and twice for the bottom )
    giving you 47.345, 94.69, 47.345 so the length that needs laser cutting from 3mm sheet steel is 189.38mm.

    the variable screen (1-8) is so you can alter the number of bends as your working through a list of parts.
    it works fine as long as you un check each box before the previous one.

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    when i visit your page set up on my server, i get no numbers i the boxes and no numbers in any small combo box at all

    I also get a page not found error with your php address in a normal browser

  10. #10
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    yeah its on our server, its an intranet site.

    most boxes are blank the Dev ones should have something, but again taken from the xml, and the combos should be populated.

    i'll try and make an offline copy and go from there.

    Cheers
    Arctic.

  11. #11
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    Even with the new url data for me to look I get this and still no numbers in the small combo boxes?

    http://fruitbeard.net/uploaded/arctic.jpg

    best try for that off line one
    Last edited by fruitbeard; 01-22-2015 at 10:29 AM.

  12. #12
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    hmm that address worked here,
    my screen attached
    error.JPG

  13. #13
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    stand down, a function is being triggered elsewhere in the script, i just need to figure out why

    Thanks for your help

  14. #14
    Junior Member
    Join Date
    Oct 2008
    Posts
    13
    PROBLEM:

    as it looped through each cb script looking if it was checked it was not looking to see if it was a user or script clicking the box

    PHP Code:
    case "4":
            if (
    cb4.selected == true){
                
    Size4i.visible true;
                
    Size4.visible true;
                
    Dev4.visible true;
                
    ang3.visible true;
                
    Line5.visible true;
                
    cb5.visible true;
                
    TID5.visible true;
                
    Size4.tabIndex 4;
                
    Folds 3;
                
    ang3.dispatchEvent(new Event(Event.CHANGE));
            }else{
                
    Size4i.visible false;
                
    Size4.visible false;
                
    Dev4.visible false;
                
    ang3.visible false;
                
    Line5.visible false;
                
    cb5.visible false;
                
    TID5.visible false;
                if (
    Folds 2){}else{Folds 2;}// this just said Folds = 2;
                
    tDev40F25 0;
                
    tDev50F25 0;
                
    tDev60F25 0;
                
    tDev70F25 0;
                
    tDev80F25 0;
                
    tDev90F25 0;
                
    ang2.dispatchEvent(new Event(Event.CHANGE));
                if (
    cb5.selected == true){
                    
    cb5.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
                }
                
            }
            break; 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center