Hi,

   I tried using validateNow, but I get the same problem. Its a
facebook application at :-aaps.facebook.com at 
http://apps.facebook.com/my_kaleidoscope/.
When I click on Sunsigns I get a blank canvas,but when I click on the
canvas, the mouseclick events meant for users get triggered properly.
So what I have is a blank canvas which when clicked randomly show the
user data properly on right pane. Please help.

On Nov 2, 12:29 pm, Vaibhav Seth <[email protected]> wrote:
> Hi,
>
> In the following code you can try the following:
>
>  public function create():void
>        {
>
>                        var borderColor:uint  = 0x666666;
>                var borderSize:uint   = 2;
>                        var xCoord:int = 240;   //original:-250
>                var yCoord:int = 300;   //original:-200
>                var radius:int = 18;
>                        var r:int = radius;
>
>                        rashiRingsArray = new Array();
>                        rashiObjectsArray = new Array();
>        //              var rashiCount:int = myXML.rashi.length();
>                        //2. Create 12 rashi circles.
>
>                        for (var i:int = 0; i < 11; i++)
>                        {
>
>                                //Big Circle.
>                                var circle1:Sprite = new Sprite();
>                                //Push rashi circle in the cirle array.
>                                rashiRingsArray.push(circle1);
>        //                      circle1.graphics.lineStyle(
> borderSize, myXML.rashi[i].color);
>                                circle1.graphics.lineStyle(borderSize,
> 0xFF0000);
>                                circle1.graphics.drawCircle(xCoord, yCoord,
> r);
>                                var shift:int = i * 90;
>                                //At the same time create a rashi object nd
> push in object array.
>                                var rashiobj:RashiObject = new
> RashiObject(myXML.rashi[i].rid ,
> myXML.rashi[i].rname, myXML.rashi[i].trait, myXML.rashi[i].count);
>                                rashiObjectsArray.push(rashiobj);
>                                //Get count of users for the rashi.
>                                var userCount:int =
> myXML.rashi[i].users.length();
>                        //      trace(myXML.rashi[i].count);
>
>                                if (myXML.rashi[i].users.length() > 0)
>                                {
>
>                                        //Initialize angle.
>                                        var angle:int = shift;
>                                        var angleDelta:Number = deg2rad(360 /
> myXML.rashi[i].count);
>
>                                        for (var j:int = 0; j <
> myXML.rashi[i].count; j++)
>                                        {
>
>                                                //Add the user to rashiobject
> array.
>                                        //      var str:String =
> convertDate(myXML.rashi[i].users.user
> [j].bday);
>                                                var str:String =
> myXML.rashi[i].users.user[j].bday;
>                                                var userObject:UserObject =
> new UserObject(myXML.rashi
> [i].users.user[j].uid, myXML.rashi[i].users.user[j].uname,myXML.rashi
> [i].users.user[j].upic,myXML.rashi[i].users.user[j].umovies,myXML.rashi
> [i].users.user[j].umusic,myXML.rashi[i].users.user
> [j].ubooks,myXML.rashi[i].users.user[j].usite,myXML.rashi[i].users.user
> [j].status,str);
>
>  //trace(rashiObjectsArray[i].getRname());
>
>  rashiObjectsArray[i].addUser(userObject);
>
>                                                //Draw smaller circle
> simulating a dot.
>                                                var dot:Sprite = new
> Sprite();
>                                                dot.name =
> (i*1000+j).toString();
>
>  dot.graphics.beginFill(0xFF0000);
>                                        //
>  dot.graphics.beginFill(myXML.rashi[i].color);
>                                                dot.buttonMode = false;
>
>                                                //Set the x and y
> co-ordinates.
>                                                angle += angleDelta;
>                                                var b:Number =
> r*Math.cos(angle);
>                                                var h:Number = r *
> Math.sin(angle);
>
>                                                var imageLoader:MovieClip =
> new MovieClip();
>
>                                                var txt:TextField = new
> TextField();
>                                                txt.setTextFormat(myFormat);
>                                                txt.name =
> (i*1000+j).toString();
>                                                txt.visible = true;
>                                                txt.width = 100;
>                                                txt.height = 18;
>                                                txt.text = "";
>                                                txt.x = xCoord+b-1;
>                                                txt.y = yCoord + h ;
>
>  txt.addEventListener(MouseEvent.MOUSE_OVER, onOver);
>
>  txt.addEventListener(MouseEvent.CLICK, onClick);
>
>  txt.addEventListener(MouseEvent.MOUSE_OUT, onOut);
>                                                dot.addChildAt(txt,0);
>
>  dot.graphics.drawCircle(xCoord + b, yCoord + h, 5);
>                                                circle1.addChildAt(dot, j);
>
>                                        }
>                                }
>                                cnv1.rawChildren.addChildAt(circle1, i);
>                                cnv1.setVisible(true);
>                                r = r + 20;
>
> can1.validateNow() or this.validateNow()
>
>                        }
>
>        }
>
> On Mon, Nov 2, 2009 at 1:10 PM, harshadaj <[email protected]> wrote:
>
> > Hello,
> >     I have a problem synchronising external data loading and drawing
> > graph as per external data.
> > I have to display 12 concentric rings(each representing a sun
> > sign"Rashi"). I take the order of rings from xml file. I have to plot
> > users as dots on the respective sunsign rings. The problem is, I get a
> > blank page without rings and all. But when I randomly click on the
> > blank canvas, the mose-click events meant for displaying the user(dot)
> > profile data from xml file get fired and I can see the users' data.
>
> >   I am trying to play with the initialize/creationComplete and
> > applicationComplete for getting the desired output. I have set startup
> > ()(which calls httpservice.send) in the initialize and create()(which
> > reads xml data and draws circles and nodes in the httpservice's
> > xmlresult success event. I am not sure of how to go about. In IE,
> > because of cache, when I reload my page, the circles get displayed.
> > But not in Firefox.
>
> > Pasting the code below:-
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > layout="absolute" width="711" height="600" backgroundColor="#FFFFFF"
> > horizontalScrollPolicy="off" verticalScrollPolicy="off" initialize =
> > "startup()">
> >        <mx:VRule x="588" y="24" width="0" height="600" />
> >        <mx:Canvas x="0" y="0" width="711" height="600" id="cnv1"
> > backgroundColor="#FFFFFF" borderStyle="none"
> > horizontalScrollPolicy="off" verticalScrollPolicy="off">
> >                <mx:VRule x="511" y="0" width="8" height="600"/>
> >                <mx:Image x="564" y="27"  id="img1" scaleContent="true"/>
> >                <mx:Label x="529" y="260" text="Favourite  Movies:"
> > width="112"
> > id="lblMovies" fontFamily="Verdana"/>
> >                <mx:Label x="529" y="388" text="Favourite Music:"
> > width="112"
> > id="lblMusic"/>
> >                <mx:Label x="529" y="499" text="Favourite Books:"
> > id="lblBooks"/>
> >                <mx:TextArea x="533" y="124" width="168" id="txtStatus"
> > height="53"
> > wordWrap="true" verticalScrollPolicy="auto" verticalScrollPosition="0"
> > editable="false" borderStyle="none"/>
> >                <mx:TextArea x="527" y="282" height="101" id="txtMovies"
> > editable="false" enabled="true" borderStyle="none" width="160"/>
> >                <mx:TextArea x="529" y="408" height="89" id="txtMusic"
> > wordWrap="true" editable="false" borderStyle="none" width="158"/>
> >                <mx:TextArea x="529" y="516" height="83" id="txtBooks"
> > wordWrap="true" editable="false" borderStyle="none" width="158"/>
>
> >                <mx:Label x="527" y="221" text="Birthday:" height="25"
> > width="101"
> > id="lblBday"/>
> >                <mx:Label x="582" y="220" width="98" id="txtBday"
> > height="25"
> > alpha="0.0"/>
> >                <mx:Label x="528" y="195" text="Name:" id="lblName"/>
> >                <mx:Label x="572" y="197" id="txtName" width="124"
> > height="18"/>
> >        </mx:Canvas>
>
> >        <mx:Script>
> >                <![CDATA[
> >                        import mx.rpc.events.ResultEvent;
> >                        import mx.rpc.events.FaultEvent;
> > //      import flash.display.LoaderInfo;
> >        import flash.display.MovieClip;
> >        import flash.display.Sprite;
> >        import flash.events.Event;
> >        import flash.events.MouseEvent;
> > //      import flash.net.URLLoader;
> > //      import flash.net.URLRequest;
> >        import flash.text.TextField;
> >        import mx.core.UIComponent;
>
> >        public var rashiObjectsArray:Array;
> >        public var rashiRingsArray:Array;
>
> >        import mx.controls.Alert;
> >        import mx.rpc.events.FaultEvent;
> >        import mx.rpc.events.ResultEvent;
>
> >        [Bindable]
> >        private var myXML:XML;
>
> >        internal var isLoaded:Boolean = false;
>
> >        internal var myFormat:TextFormat = new TextFormat();
>
> >        public function deg2rad(deg:Number):Number
> >        {
> >                return deg*Math.PI/180;
> >        }
>
> >        public function clearControls():void
> >        {
> >        //      img1.unloadAndStop();
> >                txtStatus.text = "";
> >                txtBday.text="";
> >                txtMovies.text ="";
> >                txtMusic.text = "";
> >                txtBooks.text ="";
> >                txtName.text="";
>
> >        }
>
> >        public function initControls():void
> >        {
> >                myFormat.font = "Verdana";
> >                myFormat.font = "12px";
> >                myFormat.bold;
>
> ...
>
> read more »

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to