Flex :: Where In Framework Graphics Object Passed Around To Achieve Drawing

Oct 23, 2009

I'm trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framework is the Graphics object being passed around in the hierarchy to achieve the drawing. I want to get to the level of 2D API.

View 1 Replies


Similar Posts:


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.0 :: Drawing Class That Is Passed An Image API Optimization

May 12, 2011

I'm building a drawing class that is passed an image, and it will run an ENTER_FRAME drawing lines of varying thicknesses and gradients to look as if it is being hand painted. All works well and is doing just what I'd hoped. My problem is after a while, it starts to hammer the CPU. I can understand why it could be taxing, but I thought the drawing API was meant to be rapid? Is there a way I can optimize the process? I am only using 1 enterframe, and it seems to get progressively worse the more lines are laid down. Does the Flash Player not render them as Bitmap after they are drawn? I'm just trying to work out why the more lines are drawn the heavier the swf runs.

View 7 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

Flex :: Give A Depth To An Object Created From Graphics?

Apr 18, 2011

I am drawing some lines in my program using

graphics.lineTo(xx, yy);

The program has a background image over which these lines are drawn.The problem which I am facing is that the image overshadows the lines and the lines are not visible to the user.Since these lines do not have an id, I am not sure as to how I can assign a depth to them?

View 2 Replies

ActionScript 3.0 :: Using BitmapData For Drawing Graphics?

Jun 23, 2010

I've seen the BitmapData object used for graphics a fair bit, especially in games. Many of these cases have done things in somewhat fundamentally different ways, and I was wondering what the best way generally is.

Method 1: Each animation frame is kept in a separate BitmapData object using an array.

Method 2: The animation is kept in a strip using a single BitmapData object and using the "sourceRect" parameter of copyPixels.

The draw and hitTest methods appear not to provide any "sourceRect" parameter. Most of the code I have seen using method 2 has worked around this by copying the bitmap frame into a temporary bitmap for these methods. This seems like quite a large processing overhead to me. Using method 1 this is generally not a problem, unless hitTest needs to be used with scaling and/or rotation, in which case a temporary transformed copy is still needed it seems as hitTest doesn't except a transformation.

I'm thinking method 1 is the better choice since it avoids having to make temporary copies for the most part, and I don't think it would waste much memory (just the duplicated width, height, etc values?). Is this generally true or is there a reason lots of people seem to do things the second way?

Also is there a better way to use hitTest for bitmaps that have been scaled, rotated, etc?

View 1 Replies

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

ActionScript 3.0 :: Improve Graphics Drawing Angle?

Dec 28, 2009

I have a code, that draws a horizontal line, then it turns into a slope, and at the end of the slope it draws a circle. Here's a code:

Code:
var xspeed:Number = 1; // defines increments for x of slope
var yspeed:Number = 2; // defines increments for y of slope
var hspeed:Number = 5; // horizontal line increments

[code]....

Create document 800x700 and put this code into main timeline. Now test movie As you can see, everything works great. But there is a problem. The circle is being drawn at 0 degree angle. But I want the circle to match the angle of the slope, so it looks like the slope and the circle are both at the same angle.

View 3 Replies

Actionscript 3 :: Embed Image Instead Of Drawing Graphics?

Mar 25, 2010

I've got a custom AS3 scrollbar that I need to modify. The scroll thumb (the draggable part of a scrollbar) is currently just done by drawing a rectangle. But I need it to look more like a real scrollbar. Not sure how to modify the below code to import/use a scroll thumb image:

scrollThumb = new Sprite();
scrollThumb.graphics.lineStyle();
scrollThumb.graphics.beginFill(0x0066ff);

[code].....

View 2 Replies

Flex :: Draw A Circle Inside Border Container Using Graphics Object?

Apr 5, 2011

My basic requirement is to draw a circle inside a BorderContainer with the layout set to BasicLayout.I run this method in the CREATION_COMPLETE event of the BorderContainer object.[code]I know I must be missing something VERY basic here. Can I just draw like this OR should I draw in some other event? I know that I can create a Ellipse object and easily add it to the border container but I would like to know how I can do this using the graphics object.

View 3 Replies

ActionScript 3.0 :: Drawing Objects - CS4 Pixelated Graphics In Browsers

Nov 3, 2009

I have created some graphics directly in Flash Cs4 using the drawing tools, making them 'drawing objects', yet they are pixelated when viewed in browsers. Within Flash they look crisp, but not when exported.

Here is a screenshot:
And again zoomed-in:

View 2 Replies

ActionScript 3.0 :: MovieClip Sprite Versus Drawing With Graphics

Jan 26, 2012

I have a program that dynamically draws a polygon wherever the user clicks on the screen. (using lineto, moveto) However this polygon is always behind the other symbol objects on the screen even though its added last in the childlist. Is there an issue with depth when drawing symbols vs. drawing with lines? How can I ensure my dynamic object will display in front?

View 3 Replies

ActionScript 3.0 :: How To Tween Drawing Line (MovieClip Graphics)

Jan 20, 2010

How can I Tween drawing a line mc.graphics.lineTo(); ? I just see tweener has an onUpdate property awesome.

View 0 Replies

ActionScript 3.0 :: Generate Drawing API Data From Drawing Object?

Jul 22, 2009

Basically I've got a reasonably complex drawing object in a fla and I want to reproduce it in a class definition using the drawing api. However obviously this is a tedious task, so is there some trick or automated method of doing this?

Last time I needed to do this it was a drawing of an arrow and I ended up writing down x,y,width,height values for everything but this one has curves in it which I don't have experience with drawing anyway.

View 2 Replies

Flash :: Nullify Object Passed To A Function?

Oct 5, 2010

I have the following problem with objects in actionscript3:

var o:Object = new Object();
destroyObject(o);
trace(o); // [object Object]

[code].....

View 1 Replies

ActionScript 2.0 :: Identify An Object Passed Into A Function?

Oct 13, 2010

In my case I have 6 movieclips and 6 corresponding text fields (all 12 objects are on the main timeline) and the movieclips are named thumb1_mc, thumb2_mc, etcetc, and the text fields are named text1, text2, etcetc.I have a method:mcl_mcl.onLoadProgress = function (targetMC, loadedBytes, totalBytes)in which I need to change the appropriate text file's text depending on which movieclip is targetMC.The trouble is I can't find a way to distinguish which mc it is, so I can't pick which text file to change.I tried using properties but that doesnt work because everything about the movieclip gets obliterated the moment I load something into them.

View 4 Replies

Expire Shared Object After Certain Amount Of Time Passed?

Jul 27, 2006

I have a flash movie on my index page but as the user navigates through the site and then goes back to the home page, I don't want the intro to replay. I have fixed that using shared object so that if it has already played, it skips to the end of the animation...here is my code:

function VisitCheck() {
var myLocalSO = sharedobject.getLocal("visitRecord");
if (myLocalSO.data.visited == null) {
myLocalSO.data.visited = 1;
gotoAndPlay(3);
trace("visit 1");
} else {
gotoAndPlay(2);
trace("visit2");
}}
VisitCheck();

Works great, except now, the intro animation on the index page NEVER plays again; I would rather have the cookie expire after the user closes the window or a certain amount of time has passed (say 30 minutes).

View 3 Replies

ActionScript 3.0 :: DOM Object ID Update Not Passed To ExternalInterface.objectID

Jan 13, 2010

regarding DOM object name/id updates by JavaScript, and accessing them from flash. Let me explain.

I have made an actionscript that tests if externalinterface.objectid is null. If it is, I call a JavaScript that gives names/id to all unnamed shockwawe-type <EMBED> and <OBJECT> tags.

My problem is that, although the Javascript does what it is supposed to, the SWF's ExternalInterface.objectID property remains null.

In other words, although the DOM is properly updated, that update is not propagated to the ExternalInterface object.

- Is this normal ?

- Can I "reconsctruct" the ExternalInterface object to have it updated too ?

- Could I have my SWF reload itself, and how?

- More generally, what should I be doing to be able to access the newly JS-modified id from my SWF movie ?

View 2 Replies

ActionScript 3.0 :: Get Variables That Are Passed From Html Object And/or Embed Tags

May 9, 2010

I need to get variables that are passed from my html object and/or embed tags, so I can use them in my flash project.

for example: src="/incl/flash/Line_Graph.swf?a=value1&id=1"

how can I get a and id inside my flash file?

View 3 Replies

ActionScript 3.0 :: Drawing From Bitmap To Bitmap Overrides Earlier Graphics?

Dec 29, 2010

I'm working on a game, and to keep performance good, instead of addChild'ing 50 new sprites to the stage every second, I decided to have each player draw to their own bitmap, and then to the 'master' bitmap. This introduces an issue though: the second player would override all data the first player has put into to bitmap...My basic debugging proof of concept:

Code:
// bitmap test

import flash.display.Bitmap;
import flash.display.Bitmap;[code]......

View 1 Replies

Flash :: Line Chart Possible To Achieve Using Adobe's Built In Charting Component In Flex?

Jan 13, 2012

I'm new to Flex/AS3. I've attached an example line chart below. I want to know if this type of graph can be created using the standard line-series chart available in Flex (Flash Builder 4.6), or whether there's something drawn below that is non-standard and would therefore require some rather involved customization. The key features are:

-Different line styles and colors (dashed, dot-dash, solid, thick, thin, opacity)
-Placement of units (y-axis "seconds" and x-axis "Hz")
-x-axis zoom/pan control bar below graph (move knobs in and out to set x-axis min and max plotted values)
-Log x-axis scale, linear y-axis scale
-Data Tip (or, some call it tool tip, not shown below)
-SI units for x- and y-axis tick labels.

My guess is that everything should be pretty standard to accomplish using Adobe's built-in charting (with the possible exception of item 6, see below). Is that a good assumption?I'm particularly concerned about the x- and y-axis tick labels (item 6). For example, the x-axis tick marks as a number would be:1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 but they need to be replaced with SI units, where k=1000, and M=1000000, so the corresponding marks would be (replacing the numbers above with the strings below)"1", "10", "100", "1k", "10k", "1M", "10M".The same goes for the y-axis, where p represents 1e-12, and n represents 1e-9.I can create an algorithm that accepts a number and outputs a string to do the SI unit conversion. But given that, is there a way to easily manage the tick mark labels to replace the default numbers with such strings?

View 2 Replies

Flex :: Connecting Flex Application To Tomcat + Spring 3.0 Framework With BlazeDS?

Apr 9, 2011

I'm developing a web application (client in Flash Builder 4, server in Eclipse 3.6 + Tomcat 7 + Spring 3 Framework). How do I make the Flex client automatically deploy in the Tomcat server and use BlazeDS messaging and remoting more seamlessly?

View 14 Replies

Flex :: Framework Have Used So Far?

Aug 7, 2009

I have been seeing some Flex Frameworks, but would like to ask to the programmers and Architects down here on which has suited best in your application.

View 3 Replies

Flex :: Use Framework Within An Air App?

Sep 11, 2009

Possible to use the flex 4 framework within an Air app.

View 1 Replies

Flex :: Use The Framework RSL Within An RSL?

Sep 25, 2009

I have a rather large Flex SWF and am breaking it up into separate Modules. There is some overlap between the modules and I want to put all of this into one shared RSL. The problem is that this RSL gets really large as soon as I use any Flex code because it has to include the Flex Library.Flex Builder doesn't seem to give me the option to use the Flex framework RSL in a library. Also compiling with compc and passing the runtime-shared-library-path doesn't seem to actually use the rsl.So it seems like this is something that is unsupported? Does anyone have any idea how I can do this? Is it just not possible? Is this something that is likely to be supported in the future or already supported in Gumbo?

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

Flex :: Looking A Game Framework For It?

Dec 8, 2009

I am looking a game framework for flex/AS3. I want to use it to create simple 2d games, such as tower defense, etc.

View 4 Replies

Flex :: Best Framework To Use With Spring?

Mar 10, 2010

I'm currently developing a Spring + Flex app. What is the best Flex framework to use? I've been using PureMVC...

View 1 Replies

Flex :: Intercept Value Passed To Item Editor?

Dec 28, 2011

I'm trying to intercept the value that is taken from a DataGrid's GridColumn's itemRenderer and applied to the itemEditor, and vice-versa. I need to be able to format this value. However, my project is complex, so I may be focusing on the wrong idea in what I'm trying to accomplish.

I have a Spark DataGrid component (with ID dg) that I am dynamically populating from XML. I create an ArrayCollection from some nodes, and a regular Array from sub-nodes that is added as a property of the ArrayCollection. That ArrayCollection is then used as the dataProvider for the DataGrid.

Here is an example segment of a typical XML node and it's sub-nodes:

<item name="physOrderTable" text="" type="notes">
<cols>
<col id="0" text="Day/Time" />

[Code].....

This is the only method I've been able to use to achieve the desired result. This all works fine, if all I want to do is merely display information. But I need to be able to edit the values in each cell, and apply this back to the dataProvider, as I need to rebuild XML with the updated values later.

I have tried everything I can possibly think of to be able to do this. I built my own itemRenderer, then my own itemEditor, then scrapped them because it felt like I was re-inventing the wheel. But was I? I tried reading through the code for the DataGrid, GridColumn, and related classes, but I couldn't find any reference to the itemEditor beyond it being an IFactory. I have no idea where or how it tells that IFactory to be a text input or whatever it is.

Here is my issue:

When I turn on the DataGrid's editing, and double-click a cell, it takes the entire array of the col dataField for that column's cell, converts that array to a string, and displays the entire string in the edit text box. If I cancel the editing, or save the editing, it sets the string to the .col property. Then the labelFunction tries reading that string as an array, and it crashes. I was able to get the typeof the col dataField and converting it to an array if it's a string, but I shouldn't have to.

I need to have it display just the value of the cell for that particular row and column when the instance of the itemEditor is created. When that value is changed, I need it to apply back to that column's index in the .col array of the dataProvider. So, similarly to how it displays information in the labelFunction, I need to edit the information and send it back.

I've seen lots of custom itemEditors and itemRenderers for GridColumns, but these are hard-coded in the MXML. My grid is almost entirely dynamically created, so that's unfortunately not an option for me, as I won't even know how many columns or rows there will be when the DataGrid is created. I tried using rendererIsEditor, but that only seems to be on the MXML instantiation of the GridColumn, as there's only rendererIsEditable in the ActionScript, and it doesn't seem to work (or I don't know how to use it as intended).

View 1 Replies







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