Code running backwards in commitProperties() ???

Very strange problem here. Following
this
example, I try to implement an UIComponent which shall hold a
simple graph. For some bizarre (or not) reason, the code in my
overridden commitProperties function is executed backwards?!
When creating the component in an mxml file, the alerts are
being shown in the following order:
afterloops -> lastouter -> lastinner ->
firstinner-> firstouter -> beforeloops -> aftersuper ->
beforesuper
What don't I understand here?
/*** Implement the commitProperties() method. ***/
override protected function commitProperties():void {
Alert.show("beforesuper");
super.commitProperties();
Alert.show("aftersuper");
var it:Iterator = new ArrayIterator( _data ); // iterates
through data array
var pit:Iterator = new ArrayIterator( _props ); // iterates
through properties.
var pts:Array = new Array(); // holds the points of one
dataset
var props:Array = new Array(); // holds the properties of
one dataset
var tmp:Array = new Array();
Alert.show("beforeloops");
while ( it.hasNext() ) { // iterate through datasets
Alert.show("first outer");
pts = it.next();
var dit:Iterator = new ArrayIterator( pts ); // iterator for
points
if (pit.hasNext()) { // if only one prop is submitted this
is valid for all datasets
props = pit.next();
this.graphics.lineStyle( 1, 0xff3333 ); // TODO use
properties here
this.moveToArray(scalePt(dit.next(),props)); // move to
starting point, TODO scale
while (dit.hasNext()) {
Alert.show("first inner");
tmp = dit.next();
this.lineToArray(scalePt(tmp,props)); // TODO scale
Alert.show("last inner");
dit.reset();
Alert.show("last outer");
it.reset();
Alert.show("afterloops");
invalidateDisplayList();

1. Use code tags
2. Use good names and the Java naming convention
I'd say that getGraphics() is probably where the problem is.
In my experience (on Win) everytime the paint(...) method is called, it's always a new instance of a Graphics object. Thus, in your run() method, whatever you do the Graphics objected obtained by getGraphics() won't matter.
You can have a global affine transform, and modify the transform. Then in the paint method, you can apply the transform to the original shape. If you change the original shape many times, (especially with integer coordinates), then eventually your shape morphs. You can also create a new basic stroke, but set the stroke in the paint method as well.

Similar Messages

  • Selecting clips by timecode? Can I do this? The time code is backwards., Selecting clips by timecode? Can I do this? The time code is backwards.

    Selecting clips by timecode? Can I do this? The time code is backwards, it counts down instead of up (duration) like it should.  Selecting clips by timecode? Can I do this? The time code is backwards.  I have a video project where i need to select several clips based on their timecode.  I want to also sent the playhead to a exact spot on the video. Thanks.

    It is unfortunate, but there is only one way that the Time Capsule can connect to the BT Hub, and that is by using an Ethernet connection to the WAN port on the Time Capsule.
    That could be either by running an Ethernet cable from the Hub to the Time Capsule.....or......if that is not possible, then you might be able to use a pair of Ethernet Over Powerline (EOP) Adapters to send an Ethernet signal over the existing AC powerlines in your home.
    The theory with EOP is that you already have the wiring in place, you just need the adapters.  In practice, things do not always work as well as the theory might suggest, so if you decide to try a pair, it would be a good idea to understand the store's return policy in advance before you buy. BT might even offer these devices, so check with them first on this.
    If the EOP adapters do not work well, then your only option after that would be to move the Time Capsule close to the Hub and connect the Time Capsule using a normal Ethernet cable of any length that you choose.
    I read today that I can access my time capsules data via back to my mac from anywhere in the world.
    Back to My Mac (BTMM) assumes that it is the Time Capsule that will be the "main" router on your network.....not another router....which is the Hub in your case.
    Unfortunately, you should not expect BTMM to function correctly unless the Time Capsule can be set up as the "main" router on your network.....which is likely not possible in your case.  You would need to discuss that subject with the BT support folks.

  • Help java vendingMachine code runs doesn't work Why please help

    import java.util.*;
    public class Vend
         double costALL = 40.00;
         int invALL = 3;
         String nameALL = "ALLURE OF DARKNESS";
         double costJUD = 90.75;
         int invJUD = 2;
         String nameJUD = "JUDGMENT DRAGON ";
         double costCHA = 75.50;
         int invCHA = 3;
         String nameCHA = "CHARGE OF THE LIGHT BIRGADE";
         double costCRU = 399.99;
         int invCRU = 1;
         String nameCRU = "CRUSH CARD)";
         double costGORZ = 245.29;
         int invGORZ = 1;
         String nameGORZ = "GORZ THE EMISSARY OF DARKNESS";
         double costDAD = 220.00;
         int invDAD = 2;
         String nameDAD = "DARK ARMED DRAGON";
         double savedDeckpts = 100.00;
         double input = 0.00;
         double change = 0;
         int choice = 0;
         public static void main(String[] args)
              Vend machine = new Vend();
         public Vend()
              System.out.println(" Hello Duelist, my name is Yusie Fudo.This is the one and only Specific Rare Yu-Gi-Oh! card vending.Each card in this vending machine is sealed in a special card container.These cards are up to date with the currnet ban list and pack release's.");
              System.out.println(" in order to get cards, you will be asked to pay using your Deck Points, which are stored on your Acadmey Duel Disc");
              System.out.println("Please insert Deck Points equal to the card(s) you would like to purchase or just insert 1,703.87 Deck points");
              Scanner input = new Scanner(System.in);
              double insert = input.nextDouble();
              savedDeckpts = savedDeckpts + insert;
              change = insert - change;
              while(choice != 7 && insert > 0)
                   System.out.println(" You still have " + change + " Deck Points");
                   System.out.println("Press 1 if you would like the card ALLURE OF DARKNESS from the PhanTom of DarkNess booster pack(40.00 Dp)");
                   System.out.println("Press 2 if you would like the card JUDGMENT DRAGON from the Light Of DesTruction booster pack(90.75 Dp)");
                   System.out.println("Press 3 if you would like the card CHARGE OF THE LIGHT BIRGADE from The DuelistGeneSis booster pack(75.50 Dp)");
                   System.out.println("Press 4 if you would like the card CRUSH CARD from the limited edition GoLD series booster pack(399.99 Dp)");
                   System.out.println("Press 5 if you would like the card GORZ THE EMISSARY OF DARKNESS from the Dark LeGends booster pack(245.29 Dp)");
                   System.out.println("Press 6 if you would like the card DARK ARMED DRAGON from the PhanTom of DarkNess booster pack(220.00 Dp)");
                   System.out.println("Press 7 if you would like to have your Deck points added back to your Duel Disc");
                   System.out.println("Press 8 if you would like to check how many cards are left in the machine");
                   System.out.println("(*note you need exodius the ulitimate forbbiden one's card code inorder to use option 8)");
                   choice = input.nextInt();
                   if(choice == 1 && choice <= 8 && choice >= 1 && insert >= 40.00)
                        System.out.println("Congrats Duelist you have chosen to buy the card ALLURE OF DARKNESS from the PhanTom of DarkNess booster pack");
                        invALL = invALL - 1;
                        change = change - costALL;      
                   else if(insert < 40.00 && choice == 1)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                        if(choice == 2 && choice <= 8 && choice >= 1 && insert >= 90.75)
                        System.out.println("Congrats Duelist you have chosen to buy the card JUDGMENT DRAGON from the Light Of DesTruction booster pack");
                        invJUD = invJUD - 1;
                        change = change - costJUD;      
                   else if(insert < 40.00 && choice == 2)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                        if(choice == 3 && choice <= 8 && choice >= 1 && insert >= 75.50)
                        System.out.println("Congrats Duelist you have chosen to buy the card CHARGE OF THE LIGHT BIRGADE from The DuelistGeneSis booster pack");
                        invCHA = invCHA - 1;
                        change = change - costCHA;      
                   else if(insert < 40.00 && choice == 3)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                        if(choice == 4 && choice <= 8 && choice >= 1 && insert >= 399.99)
                        System.out.println("Congrats Duelist you have chosen to buy the card CRUSH CARD from the limited edition GoLD series booster pack");
                        invCRU = invCRU - 1;
                        change = change - costCRU;      
                   else if(insert < 40.00 && choice == 4)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                        if(choice == 5 && choice <= 8 && choice >= 1 && insert >= 245.29)
                        System.out.println("Congrats Duelist you have chosen to buy the card GORZ THE EMISSARY OF DARKNESS from the Dark LeGends booster pack");
                        invGORZ = invGORZ - 1;
                        change = change - costGORZ;      
                   else if(insert < 40.00 && choice == 5)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                        if(choice == 6 && choice <= 8 && choice >= 1 && insert >= 220.00)
                        System.out.println("Congrats Duelist you have chosen to buy the DARK ARMED DRAGON from the PhanTom of DarkNess booster pack");
                        invDAD = invDAD - 1;
                        change = change - costDAD;      
                   else if(insert < 40.00 && choice == 6)
                        System.out.println("not correct amount of Deck Points.Please chose another card(s)");
                   if(choice == 7 && choice <= 8 && choice >= 1 )
                        System.out.println(" You have chosen to have your Deck Points added back to your Duel Disc");
                        System.out.println("You have revceived " + change + " Deck Points back");
                        change = change * 0;
                   if(choice == 8 && choice <= 8 && choice >= 1)
                        System.out.println("You have selected to see how many of what cards are left");
                        password();
              public void password()
              System.out.println("Please input ExodiusCardCode at this time");
              Scanner pass = new Scanner(System.in);
              String password = pass.next();
              if(password.equals("blackout"))
                   System.out.println("There are " + invALL + "ALLURE OF DARKNESS ");
                   System.out.println("There are " + invJUD + "JUDGMENT DRAGON ");
                   System.out.println("There are " + invCHA + "CHARGE OF THE LIGHT BIRGADE ");
                   System.out.println("There are " + invCRU + "CRUSH CARD ");
                   System.out.println("There are " + invGORZ + "GORZ THE EMISSARY OF DARKNESS ");
                   System.out.println("There are " + invDAD + "DARK ARMED DRAGON ");
                   System.out.println("The machine has DP" + savedDeckpts + " Inside");
    }

    hi my name is exodiamaster3.14 my code runs but when it runs it tells me
    System.out.println(" Hello Duelist, my name is Yusie Fudo.This is the one and only Specific Rare Yu-Gi-Oh! card vending.Each card in this vending machine is sealed in a special card container.These cards are up to date with the currnet ban list and pack release's.");
              System.out.println(" in order to get cards, you will be asked to pay using your Deck Points, which are stored on your Acadmey Duel Disc");
              System.out.println("Please insert Deck Points equal to the card(s) you would like to purchase or just insert 1,703.87 Deck points");
    say i type in 500 it then gives me all my choices of what to buy. when you press 1-6 it just repeats it self on what you can chose.it does subtract the money but won't show that you bought it. and when you chose option 8 it does not show what is left in the machine. this is my problem please help b/c i am very stuck. thanks again.

  • Unhandled exception when code runs for the first time,but works fine the second

    Hi All,
    I have the following code snippet
    private void RGL_Click(object sender, RibbonControlEventArgs e)
    Word._Document oDoc;
               oDoc = Globals.ThisAddIn.Application.ActiveDocument;
                object start = oDoc.Content.Start;
                object end = oDoc.Content.End;
                oDoc.Range(ref start, ref end).LanguageID = WdLanguageID.wdEnglishCanadian;
                oDoc.Range(ref start, ref end).NoProofing = 0;
    Microsoft.Office.Interop.Word.ReadabilityStatistic DocStats;
                    DocStats = oDoc.ReadabilityStatistics[10];------>exception occurs here when code runs first time
                    MessageBox.Show(DocStats.Name + " " + DocStats.Value);
    When I copy paste a document and click on the button it raises a COM exception but if I click continue and click on the button again, the correct grade level score is displayed.Cant figure out why this is happening.

    Thanks for the answer Eugene, this exception never shows up if I type something and click on the rgl button , but if i open a huge document that is already in Canadian english and click on this ribbon it gives me the following exception
    System.Runtime.InteropServices.COMException was unhandled by user code
      HelpLink=wdmain11.chm#36966
      HResult=-2146824090
      Message=Command failed
      Source=Microsoft Word
      ErrorCode=-2146824090
      StackTrace:
           at Microsoft.Office.Interop.Word.ReadabilityStatistics.get_Item(Object& Index)
           at UsabilityMapping_V01.Ribbon1.RGL_Click(Object sender, RibbonControlEventArgs e) in <my path> 1211
           at Microsoft.Office.Tools.Ribbon.RibbonPropertyStorage.ControlActionRaise(IRibbonControl control)
           at Microsoft.Office.Tools.Ribbon.RibbonPropertyStorage.ButtonClickCallback(RibbonComponentImpl component, Object[] args)
           at Microsoft.Office.Tools.Ribbon.RibbonManagerImpl.Invoke(RibbonComponentCallback callback, Object[] args)
           at Microsoft.Office.Tools.Ribbon.RibbonMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
           at Microsoft.Office.Tools.Ribbon.RibbonManagerImpl.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[]
    namedParameters)
      InnerException: 

  • How to Debug a ABAP code running the background in Portal

    How can I debug a ABAP code running in the background while executing a transaction code through portal.
    e.g Presently I have to incorporate some checks in the portal. For that I know the function module where i need to put though checks. Now I want to know, how does the code during runtime. What values do we get in the function module. For this I need to get into the debugging mode while executing the portal.
    So how can we do that???

    Namit,
    it doesnot matter whether it is a standard funtion module or a custom one .check whether you are debugging for proper user(portal user and backend user are same) and check debugging is activated

  • WILL this code run and please explain

    package onlinetest;
    public class Animal {
    public static void main(String[] args) {
    Animal cat=new Animal();
    Plz explain the concept if the code runs, how come jvm is handling by creating a object of the same class in itself. It seems to be a loop...??
    Edited by: Jaguar on Apr 21, 2011 12:09 AM

    Jaguar wrote:
    Plz explain the concept if the code runs, how come jvm is handling by creating a object of the same class in itself. It seems to be a loop...??No it isn't, but this would be:public class Animal {
       private Animal animal = new Animal();
       public static void main(String[] args) {
          Animal cat=new Animal();
    }See the difference?
    Winston

  • IPhoto album slideshow runs backwards

    iPhoto album slideshow runs backwards. Anyone any suggestions?

    Use a regular slideshow created by "File > New Slideshow".  These will play manually sorted. The instant slideshows cannot be played in a manual sort order.

  • Labview 8.5 applicatio​n builder .exe does not run.The same source code runs ok.

    Hi,
    I have an application built in labview 8.5 application builder using windows XP. I have one instrument connected in gpib and one connected to a serial port. The source code runs ok but when I build  an executable of teh same code and try to run it, it doesnt run the instrument connected to the serial port. It does communicate with the gpib port. Any ideas why this would be happening?
    Steven

    Additional to Britoa's reply:  Did you add the serial commuication (drivers) when you built the application?

  • Java options to see code running

    Is there any option I can use to run my Java in which I will be able to see my code running, what methods it calls when, all the if statements and how they are evaluated, etc. I know unix shell scrips have such a functionality, and I was wondering if Java does too.

    Or just use a debugger. e.g., jdb.

  • Every so often a window with a red frame pops up with some kind of code running. Given security problems I wondered if this was ok, an update or something?

    Basically the subject states it. Firefox seems to work okay with occasional crashes. I notice that every so often a window pops open and I see some kind of code running. Give the security issues these days I wondered if this was anything to be concerned about, perhaps an update of some sort. I didn't notice this action with my older version of Firefox. I'm on Windows 8 and I have Malewarebytes and Norton 360 installed. Or perhaps a plug in/extension is causing the window to pop open? Thanks for any insights into this.

    Do a malware check with several malware scanning programs on the Windows computer.<br>
    Please scan with all programs because each program detects different malware.<br>
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Camera could not start in LG handset but same code run well on nokia 6600

    Hello !
    my MMAPI code run well on nokia 6600 but same code can't implementing in any of LG handsets.
    it throws media exception while initializing camera so any one have the solution for that?
    premal

    Try editing boot.properties file in both Admin server and bi_server1 in these two locations
    domain/servers/AdminServer/security/boot.properties
    domain/servers/bi_server1/security/boot.properties
    Once it is done,Try restarting and let us know the outcome.
    Thanks,

  • I believe I have implemented it correctly but I am not receiving the notifications on my phone. I have an ad hoc provisioning profile set up.  I have the device token from the phone through NSLOG to console. I have the dot net code running without errors.

    I believe I have implemented it correctly but I am not receiving the notifications on my phone. I have an ad hoc provisioning profile set up.  I have the device token from the phone through NSLOG to console. I have the dot net code running without errors.The notifications just don’t appear.
    Any ideas where I am going wrong?

    IMAP account access by itself does not provide for syncing contacts, calendar events, and notes or anything over the air. This is possible with an Exchange account accessed via ActiveSync with the Exchange Server.
    If your company email account is an Exchange Account, your company's IT Dept. has enabled IMAP account access for your Exchange account on the Exchange server?
    If an Exchange account, the IT Dept. must have ActiveSync enabled for your account on the Exchange Server to create and access the account as an Exchange account which provides Push access for received messages, and over the air syncing for contacts and calendar events with the Exchange Server.

  • Ussd code running issue

    Using duel sim Ussd code running sometimes shows no result for account and packet data until restart nokia x2ds software ver 2.1.0.11 please fix bug as soon as possible.thanks

    i also have this issue ... please help

  • Communicating between Labview RT code running on windows using Linux C code over network

    Hi,
    I have been working with Labview FPGA+RT for robotic applications (impedance control, tendon driven robotics etc.) for some time now. I was wondering if anyone has successfully been able to communicate with
    shared variables being sent over a network by a labview RT program using C/C++ on a non labview Linux PC. I have been working on this for sometime and have read about CVI and Datasocket protocols. I am in the
    process of making a library on my RTAI patched Linux installation to have a high level control loop on the Linux PC communicate with low level motor control and sensor data acquisition codes running on the labview RT
    pc. In the worst case scenario I am planning to use basic network port sniffing to atleast acquire data.
    Just thought I will ask here before wasting time reinventing the wheel. Any suggestions and ideas would be greatly appreciated as well.
    Thank you for your time.
    Prashant

    Morning Prashant,
    You are on the right track. You can use datasockets from any environment to interface with a network shared variable. I've pulled some of the examples from CVI which show how to call network shared variables. These should help. You should search how to call data sockets in C then pass the address to them to read and write from. 
    Look into the polling example for the basics.
    Kyle Hartley
    RIO Product Support Engineer
    National Instruments
    Attachments:
    networkvariable.zip ‏69 KB

  • Internet Connect clock runs backwards

    Occassionally the clock that says how long you've been connected to the PPOE will run backwards on computers connected wirelessly to the airport network until I restart the computer that the airport is physically connected to.
    Aside from that, almost everyday, I need to restart my modem to get the network running again.  I have a DSL connection going into a Westell modem from Verizon.
    Curious is anyone has run into the backwards clock thing.  It doesn't seem to effect the connection.  Never had it reach 0.  Who knows what disaster might unfold if it did.

    The Internet Connect clock (or timer, if you like) on both of my Macs is now running backward after updating my Airport Extreme base station software - since Apple was saying it was time to update.
    I have tried resetting my machines to no avail.  I thought about going thru the Airport utility to see what I could do there, but I need to make sure I have all my set-up parameters and options written down first .. just in case.
    I would really like to find out how to fix this, but I haven't seen much posted around the net.
    James Goss

Maybe you are looking for

  • In-app purchase of tangible goods

    Hi, I like apps that teach us and our kids. I also like in-app purchases. They allow developers to offer their apps for free with some partial (but very useful) content and make money with additional content/software that they sell as add-ons. I clea

  • Dynamic Check Box Error

    Hi All,         I have created Dynamic UI Checkbox which is creating dynamic checkboxes based on the database Table fields. Here is my code in Start View // This file has been generated partially by the Web Dynpro Code Generator. // MODIFY CODE ONLY

  • Query migration - Variable error

    Hi,   I'm trying to migrate this query from 3.5 to 7.0 when I get the follwoing error. SAP Supplied variable 0S_CTELM(Campiagn Element). I'm using this to restrict a characteristic "Campaign". There is a hierarchy that needs to be in place. THis quer

  • Flickering Video Final Cut Express

    Hi! There is a fair amount of flickering when I do cross-fades manually (with superimpositions) on Final Cut Express (the version I have is at least a couple of years old), and I was wondering whether it was playback quality or whether it is somethin

  • How can I retrieve photos imported from a CF card?

    I have imported photos from a CF card to my MacBook Air via card reader to iPhoto, later exported a couple of them to Facebook (i.e., I saw them in my iPhoto library after import). Then they disappeared. I run Yosemite and and have the latest version