Flex :: Rect Drawn With Graphics Appear Below Background Of BorderContainer?

Nov 2, 2011

In a Flex component that inherits from BorderContainer I'm overriding the updateDisplayList function to draw a rect:

override protected function updateDisplayList(unscaledWidth : Number, unscaledHeight : Number) : void
{

[code].....

View 2 Replies


Similar Posts:


Flex :: Change BorderContainer Background Color With AS

Oct 7, 2010

I'm trying to change the background color and or text color of a BorderContainer in flex 4 using Action Script, but have not idea how to. The Border Container component doesn't seem to have any properties like:
idname.color = "#333333";
idname.backgroundcolor = "#333333";
How might I go about doing this?

View 2 Replies

Flex :: Objects Drawn By Flash Graphics Class Exist As Objects?

Jan 16, 2011

Internally Flash obviously keeps a list of the primitives drawn using Graphics so I wondered if you have many such primitives in a Sprite, can you re-position/remove/alter individual items rather than clear and re-draw everything? Or is this deeper into the bowels of Flash than you're allowed (or recommended) to go?

View 4 Replies

ActionScript 3.0 :: Resize The Background Rect Shape According To The Text Label

Nov 5, 2009

Im creating a button, with a background rect shape and a text label. Im trying to resize the background rect shape according to the text label.For example, if my text label says "work" the background rect shape will be smaller then if my text label says "employment".

View 1 Replies

ActionScript 3.0 :: Know What Has Been Drawn In A 'graphics' Object

Jul 17, 2009

Lets say I have a customMovieClip. I sometimes draw an ellipse with customMovieClip.graphics and sometimes a rectangle. Now I want to know what was the shape ( ellipse/rect) that was created using a particular graphics object. Doing this would enable me to pinpoint what exactly to do with that customMovieClip() instance.

View 3 Replies

ActionScript :: Masking Programmatically Drawn Graphics?

Feb 20, 2011

suppose i have a large, static, programmatically drawn vector graphic that extends well beyond the stage.

is it recommended to mask the graphic with the stage dimensions? does the VM still draw the portion that is not on the stage?

does masking half of a programmatically drawn graphic reduce the drawing process by half?

View 1 Replies

ActionScript 3.0 :: Edit Pre-drawn Graphics From The Library?

May 30, 2009

Is it possible to edit vector drawings made in Flash (and in the FLA's library) within Actionscript? For instance, to change the line width or line color?

View 2 Replies

ActionScript 3.0 :: Knowing What Has Been Drawn In Graphics Object

Jul 17, 2009

Lets say I have a customMovieClip. I sometimes draw an ellipse with customMovieClip.graphics and sometimes a rectangle. Now I want to know what was the shape ( ellipse/rect) that was created using a particular graphics object. Doing this would enable me to pinpoint what exactly to do with that customMovieClip() instance.

View 3 Replies

ActionScript 3.0 :: Toggle Line Drawn With Graphics.DrawPath?

Mar 7, 2011

I have an application that creates a chart dynamically. This chart has a lot of information plotted on it (4-6 stock trends). I want to be able to toggle some of those lines with a button. Each trend is drawn with something like this:

Code:
// establish a new Vector object for the commands parameter
var line_commands:Vector.<int> = new Vector.<int>();
line_commands.push(1,2,2,2);
// establish a new Vector object for the data parameter
var line_coord:Vector.<Number> = new Vector.<Number>();
// use the Vector array push() method to add a set of coordinate pairs
line_coord.push(0,0, 75,50, 100,0, 125,50);
graphics.drawPath(line_commands, line_coord);

How would I toggle the line I just drew? My first idea would be to put some of this code inside a function and redraw the line with the same color of the movie's background color. I don't know if this is the best option, I was wondering if I could draw this line inside a Sprite or Movie Clip and just toggle its visibility?

View 2 Replies

ActionScript 3.0 :: Altering Drawn At Authoring-time At Runtime Graphics?

Feb 13, 2009

Is it possible to access the graphics.* - characteristics of objects that I have drawn at authoring-time at runtime? If I have drawn a single line in a movieclip I'd like to do sth like this:

[Code]...

View 2 Replies

Actionscript 3 :: Positioning Flash Graphic Drawn With Graphics Class?

Mar 3, 2010

I'm using Flash CS3 to build a simple drawing application. When the user clicks a button, they select a particular movieclip. After clicking elsewhere on the stage, the clip is instantiated and added to the stage at the position of the cursor. I've also added the option of being able to click on the added clip and drag it around on the screen. And this all works fine.

The problem is that I also want to be able to dynamically draw and add objects to the stage via the Graphics class. Whenever I add objects in this manner, their x and y coordinates are always 0,0 no matter where I place them on the stage. This makes positioning these graphics very very problematic. I created a modified positioning function specifically for these dynamically drawn graphics and while it does "work", it feels less responsive than the positioning for movieclip objects. I'm still trying to optimize this function, but it seems to me that the ideal solution is for the graphics to have non-zero coordinates when placed in the middle of the stage like movieclip objects. Is there some "workaround" to achieve this?

View 3 Replies

Actionscript 3 :: Resize A Rect Within Another Rect?

Aug 27, 2011

I draw a rectangle within another rectangle like this (I use it as a mask):

CanvasBorder.graphics.beginFill(0xf0ff00,0.1);
CanvasBorder.graphics.drawRect(100,100,550, 300);
CanvasBorder.graphics.drawRect((stage.stageWidth/2-Canvas.width/2),(stage.stageHeight/2-Canvas.height/2),250, 150);
CanvasBorder.graphics.endFill();

effectively its a 550x300 box with a 250x150 cutout.

Within one of my functions I need to resize the INNER 'cut-out' box from 250x150 to 150x100 - but keep the OUTER box exactly the same.

Normally when I'd resize a normal rectangle I'd do this:

rectangle .width = 150;
rectangle .height = 100;

View 1 Replies

ActionScript 3.0 :: Resize A Rect Within Another Rect?

Aug 27, 2011

I've got a tricky one that's stumping me, could you take a quick look over it I draw a rectangle within another rectangle like this:

Code:
CanvasBorder.graphics.beginFill(0xf0ff00,0.1);
CanvasBorder.graphics.drawRect(100,100,550, 300);

[code].....

View 2 Replies

ActionScript 3.0 :: Add Texture (image Fill) To A Line Drawn With Graphics.lineTo()?

May 15, 2009

I am trying to draw a  line from x1, y1 to x2,y2 and i want it to be a line that repeats a pattern from an image. All I can see is that you can only draw lines and change their color or thickness but I would like it to repeat an image. Is that possible or do i have to use a really long and thin rectangle with a bitmap fill?The problem is I am making a game where the user will be able to actually draw the line so i have to make it be created dynamically. The game fantastic contraption [URL] has in the game a feature where you draw lines of any length and position that are filed with a picture.

View 13 Replies

ActionScript 2.0 :: Background Gets Drawn In Front Of MovieClip

Oct 22, 2003

I have some text placed on the 'canvas' in Flash. I also draw some stuff in an onEnterFrame function on the main timeline. The stuff I draw in the onEnterFrame gets placed behind the text I have on the canvas. I'd really like to have the stuff I draw in front, but I don't know how to accomplish this.

View 1 Replies

Flex :: Rect Rounded Corners Be Different?

Jun 21, 2010

When I use <s:Rect> to create a rectangle, I use radiusX to get rounded corners. Problem is all are the same roundedness. Is there something similar to Rect that lets me control the radius for each corner separately? If not, what's the best way to create this from scratch? graphics library or what?

View 3 Replies

Flex :: Toggle A Mask To A Group In Flex (works For BorderContainer)?

Oct 6, 2011

Here's my test application:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]....

I would expect the mask to be applied when the checkbox is selected, and removed when it issin't. But it doesn't seem to work.However, when you change to , it works like a charm. Can anyone explain to me why?

Note: In my actual application, i'm applying this in a skin to a component that is extending SkinnableComponent which can't use BorderContainer so a solution to this would be great.

View 1 Replies

Flex :: Converting Mxml Rect & SolidColor To Actionscript?

Mar 19, 2010

how to use actionscript over mxml for flexibility. I have this simple block of mxml that I'm trying to convert to actionscript, but I'm stuck half way though

<s:Rect id="theRect" x="0" y="50" width="15%" height="15%">
<s:fill>
<s:SolidColor color="black" alpha="0.9" />

[Code]....

What's the most efficient way to add the SolidColor in as few lines of code as possible.

View 2 Replies

Flex :: BorderContainer As Foreground Object

Sep 12, 2011

I am searching for a way to have my spritevisualelement have round corners so that it is displayed in a circular shape.The SpriteVisualElement contains a Video Stream from FMS to display but I do not want it to be rectangular.[code] But the Container keeps being in the background and the whole remote Video which is displayed in the "vid" (=id) is in the foreground.How can I set the Container to be in Foreground? then just setting whole application background would do the job.

View 1 Replies

Flex :: BorderContainer Corner Rounding Only At Top Or Bottom

Jul 9, 2011

I need to round at only the top or bottom of a border container not all four corners, is their some CSS that I can use or do I have to create two new skins. I was reading their used to be a property for this for HBox back in the old days, is their not a property for BorderContainer now?

View 1 Replies

Flex :: Jerky Mouse Movement On BorderContainer

Sep 4, 2011

It seem when I trying to drag the bordercontainer to move along x-axis position on mouse down. It appear to move stable but became jerky when I drag a little faster.Any way to get bordercontainer move with smooth motion?[code]

View 2 Replies

Flex :: 4.5 - Create A Resizable Bordercontainer With 8 Dots?

Dec 26, 2011

I would like to have a bordercontainer in Flex, that the user can resize on his own with 8 dots in the top left, top, top right, left, right, bottom left, bottom and bottom right (like MS Paint etc.) Does Flex have a default solution for this, or do I have to write it myself?

View 1 Replies

Flex :: Set BorderContainer's BorderWeight, Contained Label Is Shifted?

May 22, 2011

I have a BorderContainer with a Label inside. I need this Label to be centered inside the container. BorderContainer has no layout (I guess it getst the default one, basicLayout...).

My code:
BorderContainer's definition:
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].....

View 1 Replies

Flex :: Change Spark BorderContainer Default Height?

Sep 29, 2011

How to create horizontal layout container like HGroup but with border and border radius?In this example there is some default height:

<s:BorderContainer width="100%" borderWeight="2" cornerRadius="5">
<s:layout>
<s:HorizontalLayout/>

[code]....

I want it to have height of the heighest element in container. Like in HGroup. Add: Why is height for above example BorderContainer equal to 112 ?

View 2 Replies

Actionscript 3 :: Control The Depth (z Index) Of Bordercontainer In Flex?

Mar 3, 2012

i'm desperately trying to set my border container the highest z-index so it will always appear on top.

how can I know how many objects are in my flex stage, so i'll be able to set the bordercontainer the highest depth? what shell i write in the depth property in order the border container would always be on top? (it's important to mention that i created dynamic objects)

<s:BorderContainer includeIn="state2" width="200" height="200" backgroundColor="#992F2F"
horizontalCenter="-61" verticalCenter="23" depth.state2=currentState.num>
</s:BorderContainer>

View 1 Replies

Flex :: Collapsing A Spark BorderContainer Dynamically Does Not Collapse Its Children

Sep 2, 2010

protected function lbHideQuery_clickHandler(event:MouseEvent):void
{
if (lbHideQuery.selected)
{

[Code]....

View 1 Replies

Flex :: Spark BorderContainer - Draw Border For Specific Sides?

Dec 6, 2010

Is there a way to easily specify on which sides a border is drawn for Flex 4's Spark BorderContainer?[URL]But that uses MX styling which seems like a hack. Is there a better or 'correct' way without having to build a skin? It seems incredibly silly to build a skin for a 'Bordered' component when this is a very common use case.

View 1 Replies

Flex :: Flash Builder 4: Error #1009 In When Button Is Wrapped In BorderContainer

Sep 7, 2010

I have a component where a Button is wrapped in BorderContainer. I'm passing a custom property to the component at run-time to change the label of the button but Flex is reporting the following error:

Cannot access a property or method of a null object reference

When the error occurs, Flex highlights the following code:

myButton.label = value;

Here's the app:

// MyApp.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

[code]....

View 1 Replies

Flex :: How To Rotate Drawn Rectangle

May 18, 2010

I wrote the following code for drawing a rotate rectangle
var s:UIComponent = new UIComponent();
s.graphics.lineStyle(1, 0x0000FF);
s.graphics.drawRect(50, 50, 200, 200);
s.rotation = 30;
template.addChild(s);
Where template is a canvas. Its rotate nicely but the problem is the position is not in right place. i.e. it is not in (50,50) after rotate.

View 1 Replies

Flex :: After Importing A PNG With Transparent Background It Shows Up With White Background

Dec 28, 2010

As the title already states i have a (big) problem importing a PNG in a Flex 4 application.Created a PNG file in Photoshop with transparent background. Loaded in Flex application using this code:[code]So when the complete event fires the data has been loaded and it is possible to assign the data loaded to the image component named Thumbnail:[code]Unitls now everything works as expected!But when i try to send the Thumbnail component's data to a WCF service i receive a photo with white background:[code]

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved