Flex :: Graphics - Assigning Id To Primitives?

Apr 21, 2011

I have created a few flex primitives on screen via action script. Now based on business logic, I need to make changes to some of these primitives such as: changing thickness, direction of arrowhead etcOne thought was to assign id's to these primitives as they are built- how do I do that?e.g. I get a line built as below

var myShape:Shape=new Shape();
myShape.graphics.lineStyle(thickness,color);
myShape.graphics.moveTo(XFrom,YFrom);

[code].....

View 2 Replies


Similar Posts:


Flex :: Graphics - Filling Color In An Object Built Using Primitives

Apr 22, 2011

I have a bounded object, created using primitives lines in Action Script- either an oval or a triangle. Is there any way I can fill the contents in a specific color

Just to clarify on this- the shape could be in two ways

a) drawing a isoceles triangle based on a variable apex angle

b) two curved lines to form a "lens"

I am not sure if I can use the fill function, as I am not drawing a inherently bounded shape- the closed nature is based on my calculations

[Code]....

View 3 Replies

C++ :: Why Some 'Types' Are References While Some Are 'Primitives'

Mar 19, 2012

Types like Movieclip , String, Object act as references when declared and defined, while types like int, Number are primitives. Why such difference has been made. Why not all of them can be primitives ?

View 1 Replies

ActionScript 3.0 :: Clear All The Primitives From The Scene3D?

Jan 15, 2009

Once you populate a Scene3D with primitives (say in a for loop), how do you clear all the primitives from the Scene3D?

View 3 Replies

ActionScript 3.0 :: Assign Primitives To New Variables By Reference?

Feb 8, 2011

As primitives are copied as 'value' not by Reference, this doesnt work:

ActionScript Code:
var myPrimitive1:int = 10;
var myPrimitive2:int = myPrimitive1;
myPrimitive2 = 20; // i want this to affect myPrimitive1 too

My goal is to pick a random property on a data Object() and alter that. My approach was to put all the Objects properties into an array, and then randomise that array, and pick the first element. The only problem is of course that, that element is no longer a Reference to the original, so If I change that it wont alter the original...

ActionScript Code:
// Create Data Object
var myObject:Object = new Object();
myObject.primitiveVar1 = "string1";

[Code].....

View 7 Replies

ActionScript 3.0 :: Script Animation Of Oval Primitives?

Dec 16, 2009

I was in an AS3 course last year and the instructor mentioned that the Oval Options of an Oval Primitive -- start angle, end angle, inner radius -- could be animated in AS3.Does anyone know if this is true, and if so, what are the Classes involved? I've been through everything I know and I can't find a reference to it.

View 6 Replies

XML :: Free Flash Components To Render Graphic Primitives

Feb 13, 2012

I need a compiled and ready-to-use Flash lib, which is able to draw in browser basic primitives (contours, points and labels, not just a charts), described in XML given to the script. It is desirable that the library had at least basic functionality for styling displayed objects: gradients, borders, basic animation, HTML markup. GPL and other free licenses are preferred.

View 1 Replies

ActionScript 3.0 :: Animate A Few Primitives That Have Been Created Dynamically With Tweener

Jan 30, 2009

I am trying to animate a few primitives that have been created dynamically with tweener. It works if the tweener method is inside the loop, but not when it is outside.

[Code]....

View 2 Replies

ActionScript 2.0 :: Attach Graphics Instead Of MC Cause A Graphics File Size Is Relatively Small Than That Of A Graphic?

Apr 9, 2005

I was wondering about MC and hey can help to lag a game out. I set up an advanced class system so i don't have to use MC to simulate walls, all i use isthe x,y,width and height. Well anyway since i don't need MC anymore I was wondering if there is a way to attach Graphics instead of MC cause a Graphics file size is relatively small than that of a graphic, I think. If anyone could tell me thats true and show me a way to attach graphics that would be nice. I haven't tried it yet but maybe if I exported the graphic from the library imihgt be able to call its name, but it doesn't have an instance name so im stuck.

View 2 Replies

ActionScript 3.0 :: 1119: Access Of Possibly Undefined Property Graphics Through A Reference With Static Type Flash.display:Graphics.

Oct 8, 2009

i am trying to receive in my function as a parameter either a shape or a sprite and then access their graphics property, but this gives me an error:

Code:
public static function makeRect( obj:DisplayObject, ...
var g:Graphics;
if(obj is Sprite){

[code]...

//1119: Access of possibly undefined property graphics through a reference with static type flash.display:Graphics.

View 1 Replies

Flex :: Assigning An Array Of Objects To A DataGrid?

Aug 24, 2009

When the dataProvider for an DataGrid is an array of objects, how do I set each column's dataField to a property of the object.I have an ArrayCollection (say a) where each item is an objectFor example a[i] = data:ObjectWhere the object data has some subproperties - data.name, data.title, data.content etc.I have a DataGrid in which I want to display this data.So I put:

<mx:DataGrid id="entries" dataProvider="{resultRSS}">
<mx:columns>
<mx:Array>

[code]......

View 1 Replies

Flex :: Assigning XML Into Specific DataGrid DataFields

Mar 26, 2011

Coming back to flex after not using it for a while, trying to load some xml (generated by php) into a datagrid using dataprovider to create a simple grid showing the daily high and low temperatures over the course of a week. I can get the data to display in my datagrid, but the columns are loading in random order. (So friday is coming before monday etc.) How to assign specific data to specific datafields.

Here's the flex code; (updated to working code. Note that the dataFields simply contain the names of the xml tags and/or the names of the tags within those tags)
<?xml version="1.0" encoding="utf-8"?>
<fx:Declarations>
<s:HTTPService id="weather" url="[URL]" result="weather_resultHandler(event)" fault="weather_faultHandler(event)" />
</fx:Declarations>
[Code] .....

View 1 Replies

Flex - Graphics - Code Of Drawing A Text Curve In Flex?

Feb 1, 2011

I just need a simple code of drawing a text curve in flex

View 2 Replies

Actionscript 3 :: Not Assigning Data From Java VO To Flex VO Using Cairngorm?

Jan 23, 2012

I have a few values in Java VO, and using cairgorm framework, i had mapping the Java VO to Action script VO in Flex and given same variables name as java Vo variables name. Now the Vo is mapping fine and when looking the result all variables are displaying as null. Can i know the reason for that.Java returning list of VO's.

package com.configuration
{
import com.adobe.cairngorm.vo.IValueObject;

[code]......

View 1 Replies

Flex :: Flash Builder - Not Assigning Data To Variables?

Mar 4, 2012

I am trying to assign a value from my database to a variable inside my Flex application. So far I read up a few ideas and I have at the moment the following code using a PHP web service:

protected function btnSubmitUser_clickHandler(event:MouseEvent):void
{
username = txtUsername.text;

[code].....

View 1 Replies

Flex :: Generating Flex Like Graphics Server Side?

Oct 21, 2011

I know flex is a client side technology, but our customers are asking us to e-mail them reports (i.e. graphic images) that look just like the flex graphics we show them on the desktop on a nightly basis.

View 3 Replies

Actionscript :: Flex Assigning Events To Dynamically Created Buttons?

Jul 18, 2011

My app has buttons that users press to insert predefined strings into a textarea. I'm now making it load in the button values dynamically so users can define their own buttons.I'm using a buttons.txt which contains a different label on each line (button1, button2,button3 etc). I loop through the text file and add the buttons to a group. This all works, but now the hard part. How can I assign an eventlistener to these buttons so that they output text to the screen?

protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
var path:File = File.documentsDirectory.resolvePath("buttons.txt");

[code]......

View 1 Replies

Actionscript :: Flex: Assigning Events To Dynamically Created Buttons?

Jul 19, 2011

I have a txt file structured like this:

button1_label
button2_label
button3_label

[Code]....

View 2 Replies

Actionscript :: Flex 4.5 - Assigning A Variable After Service Data Load

Nov 20, 2011

I have generated a service call to a service called ServiceName.getService() - I can successfully pull data displayed inside mxml layout elements, but, instead of displaying it, I just want to assign it to a global.

I always get an error on the second line below - apparently the value has not been fetched yet. I have also tried adding a listener, and setting the global value on COMPLETE, but that is apparently never called. (I am guessing this generated service call stuff does not actually trigger a COMPLETE?)

Short question is: how do you simply assign a variable after you have loaded it via a service data call. (Not just HTTP)

getServiceResult.token=ServiceName.getService();
GlobalVars.variablename = getServiceResult.lastResult.variablename;

View 1 Replies

Flex :: No Graphics Environment Available

May 7, 2011

I am getting below error when I try to use hudson and maven [code]...

View 1 Replies

Flex :: Containing Graphics In A Container?

Oct 31, 2011

I'm using flex and drawing a circle using the Spark Ellipse primitive. I am setting the x,y coordinates of the circle myself. I am drawing them within a TitleWindow component. Is it possible to force the circle to not be allowed if I specify a coordinate that is outside the TitleWindow? Or do I have to check the coordinates manually myself?

View 1 Replies

Actionscript 3 :: Dynamically Assigning An Image Source In An Item Renderer Does Not Work In Flex?

Oct 23, 2009

I have a custom item renderer that displays images:

<mx:DataGrid dataProvider="{friends.friend}" id="friendsGrid" width="240" rowCount="3" variableRowHeight="true" headerHeight="0"
horizontalCenter="true" backgroundAlpha="0" borderThickness="0"

[code].....

View 1 Replies

Flex :: Set Text On A Graphics Object?

Oct 19, 2011

Is there anyway I can effectively call the equiv. of setText on a Flex Graphics object ?Specifically I'm using a custom cell renderer to display data in a datagrid. The renderer uses the Graphics object to set the background colour of only a portion of the cell (say the left half) based upon the underlying data. I would like to be able to have text over only that portion of the cell which has the background colour (eg centred within the left half). I know all the widths (of both the cell itself and the graphics object) but I don't know how I can set text (centred) over the graphics object.

View 5 Replies

Flex :: Set Text On Graphics Object?

Nov 3, 2009

Is there anyway I can effectively call the equiv. of setText on a Flex Graphics object ?

Specifically I'm using a custom cell renderer to display data in a datagrid. The renderer uses the Graphics object to set the background colour of only a portion of the cell (say the left half) based upon the underlying data. I would like to be able to have text over only that portion of the cell which has the background colour (eg centred within the left half).

I know all the widths (of both the cell itself and the graphics object) but I don't know how I can set text (centred) over the graphics object.

View 4 Replies

Vector Graphics - Creating FXG For Flex?

Aug 9, 2010

I need to create flash content dynamically- towards that need to build images. I need help on two points

a) are vector graphics always better than raster graphics on size/ do vector graphics take longer to render

b) do we have open-source tools to create fxg files to import into flex builder

View 3 Replies

Flex :: Parameters Of Element From Graphics

Nov 25, 2010

how do you know the parameters (eg height and width) of the element, if the constructor is passed only his Graphics?

View 1 Replies

Flex :: Drag And Drop Of FXG Graphics

Apr 27, 2011

I am building a flex project involving drag+drop of fxg graphics. My graphic is instantiated as below:
<graphics:arrow2 id="object" mouseMove="mouseMoveHandler(event);" />
I get an error: "Call to a possibly undefined method Graphic."

This works if I change my drag-object to Image and replace the 'Graphic' below with 'Image'. What should I use to be able to reference the fxg graphic in the drag-drop? My drag drop functionality is as follows
private function mouseMoveHandler(event:MouseEvent):void {
var dragInitiator:Graphic = Graphic(event.currentTarget);
var ds:DragSource = new DragSource();
ds.addData(dragInitiator,"gph");
DragManager.doDrag(dragInitiator, ds, event);
[Code] .....

View 1 Replies

Graphics - Remove Line In Flex?

Feb 28, 2012

I'm drawing a line using this code:

this.graphics.moveTo(posx, posy);
this.graphics.lineTo(2*posx,2*posy);

But now I want to remove it, but I can't clear the whole this.graphics object because it contains more information that is useful for me. How can I remove this line without clearing this.graphics object? Is there any method to draw a similar line over it to hide or replace the line?

View 2 Replies

Flex :: Difference Between <s:Line> And Graphics.lineTo()?

Sep 28, 2010

If I skin a button and use the AS3 graphice.clear() and graphics.lineTo and beginFill to create a shape, the button overlaps other items in the container.

When I use the and mxml to create the same shape, the button is neatly positioned inside the container.

View 2 Replies

Flex :: Actionscript Graphics Connecting 2 Sprites

Dec 28, 2010

Is it possible to draw 2 rectangular shapes of "Box A" and "Box B" and place them apart, next, adding a magnetic line (black line) between them which will keep them connected without having to manually update the line xy position?

View 1 Replies







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