View Full Version : Triangle Item Renderer
precator
12-14-2007, 02:51 PM
Is there any way to make the triangle point downwarrds. We are making a stock chart with buy / sell signals and would like down arrows to signify sells..
precator
12-14-2007, 09:11 PM
If anyone could assist me on this I would appreciate it.. Thank you kindly..
pradeepkumarnd
12-21-2007, 03:47 PM
If anyone could assist me on this I would appreciate it.. Thank you kindly..
Hi,
Create the component like drawTriangle.as, inside this class draw triangle using "graphics" class by passing dynamic parameters or staic values. Then you can render that component whereever you want.
Thanks,
PradeepKumar.D
slimemonkey
12-30-2007, 08:41 PM
My question is on a very related note so I didn't want to create a new thread.
What is wrong with the following code? I have gotten this to work in Flash CS3 but when I tried it in Flex 2, it refuses to generate anything!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function init () :void {
var sampleMC:MovieClip = new MovieClip();
sampleMC.graphics.lineStyle(1,Math.random()*0xFFFF FF,.5);
sampleMC.graphics.beginFill(Math.random()*0xFFFFFF );
sampleMC.graphics.drawRoundRect(0,0,100,20,10);
sampleMC.graphics.endFill();
sampleMC.x = Math.random()*550;
sampleMC.y = Math.random()*400;
addChild(sampleMC);
Alert.show("Never Reaches Here!");
}
]]>
</mx:Script>
</mx:Application>
slimemonkey
12-31-2007, 03:38 AM
Never mind, I found a solution. I made an instance of the object UIComponent instead of MovieClip and it worked exactly as I wanted it to! Can someone explain this behavior?
My theory is that in the Flex framework, UIComponent is the base class for any item that is displayed on the screen.
hangalot
12-31-2007, 01:49 PM
its based on the measurement inside the flex framework. read up about createChildren, and all the invalidate functions
slimemonkey
01-01-2008, 06:42 AM
Um... I do remember reading somewhere about createChildren(). I wrote some code in AS 3 that worked in Flash CS3 and that program had a bunch of classes that extended MovieClip. I took that exact code and changed "MovieClip" to "UIComponent" (i.e. made everything extend UIComponent instead of MovieClip) and it worked just fine. I have not defined an override of createChildren() anywhere...
Where can I read up on the Flex framework and which functions I need to define?
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.