Actionscript 3 :: How To Position ItemRenderers

Nov 22, 2011

I'm quite new to flex and ActionScript and I'd like to create a custom component acting as a calendar (using a Sprite), in which the calendar events are represented as rectangles the user can interact with (click to get information about the event, drag and drop for setting start and end dates...). It seems that using a subclass of DataGroup is a good way to do it, but some things are obscure to me.For example, how should I use the Sprite? as a child of the DataGroup? Also, the calendar events will be drawn using a custom ItemRenderer, and I will have to use a BasicLayout in my DataGroup, but where should I tell that an ItemRenderer should draw its rectangle in the Sprite at the corresponding (x,y) coordinates?

View 1 Replies


Similar Posts:


Flex :: Scroll When Tabbing Through Itemrenderers?

Jan 18, 2012

To allow you to tab through itemrenderers in spark you simply set hasFocusableChildren="true". However when you tab to a row/tile which is not visible, it doesn't automatically scroll the List.

What's the easiest way of making this happen?

View 1 Replies

Flex :: Force All Tree Itemrenderers To Refresh?

Apr 6, 2010

I have item renderers in an mx.controls.Tree that I need to refresh on demand.

I have code in the updateDisplayList that fires for only some of the visible nodes no matter what I do. I've tried triggering a change that they should all be listening for; I have tried clearing and resetting the dataProvider and the itemRenderer properties.

private function forceCategoryTreeRefresh(event : Event = null) : void
{
trace("forceCategoryTreeRefresh");

[Code]....

The nodes refresh properly when I scroll them into view (e.g. the .data gets set), but I cannot force the ones that already exist to refresh or reset themselves.

View 2 Replies

Flex 4 List ItemRenderer - Different Itemrenderers For Different Rows?

Jun 28, 2010

I'm creating a list of scores for a game. now most of the list i need to have the same ItemRenderer. but in one specific row of the list where the user who's playing is listed, it should show different information and with different background color. how can i achieve this ?

I already tried to resolve the issue with states, i created 2 states, one state called 'mine' and the 2nd state called 'others'.

the problems that i got is that when users click on one of the list rows that state changes to i donno clicked or something and that's why i assumed that states are not the right action for me.

View 3 Replies

Flex :: Get The Itemrenderers To Divide The List Width Between Them?

Mar 22, 2011

I have a List class with an itemrenderer. How can I get the itemrenderers to divide the List width between them? Normally, I would think this would be a easy as giving the renderers a percent width but that no worky.

Application:

<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"[code]..............

View 1 Replies

ActionScript 3.0 :: Flex - Complexity Of ItemRenderers In Lists

May 14, 2008

I'm building fairly simple item renderers, in fact, here's the code for one of them...

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
implements="mx.controls.listClasses.IListItemRenderer"

[Code].....

It's a really simple renderer that has an image and some text sitting next to it, or just the text if no image is in that item's data provider. There is also some basic rollover, rollout and click functionality...

So my question: Why is it that if my list needs to scroll it gets messed up? By "messed up" I mean that the text changes from being to the right of the image (when image is present) to moving over top of the image, as if it isn't realizing that the image is there. There's also sometimes an issue of the item renderer shrinking down so there is no longer anything even visible in the box (just some black with a grey border on the bottom about 5 - 10 pixels big...

I'm wondering if maybe my item renderer is too complex? I'm having the same issue with text working like that in another renderer, but no images, just text placed in certain positions (as well as some strage blue tints showing up at the top or bottom depending on how I am scrolling)

By the way... here is the MXML where I am initializing my list...

Code:
<mx:Canvas width="100%" height="100%" id="list">
<mx:List
width="100%"

[Code].....

View 1 Replies

Flex :: Where Should SetStyle Logic Go In Itemrenderers's Override Methods

Aug 4, 2011

I have following itemrenderer

[Code]...

My question is Should above logic go in updtaeDisplayList or remain in set data() itself. The output is smae from both. Whats the performance impact difference if we consider it from lifecycle perspective.(The heavy computations should be pushed towards the end of the frame rendering)

View 1 Replies

Flex :: Delete Itemrenderers In A Spark Listform For Mobile?

Oct 4, 2011

I've got a spark ListForm with a custom mxml itemRenderer,all the itemRenderer has is[code]...

View 1 Replies

Flash :: Setting Transparency Of Itemrenderers In Spark List?

Jan 25, 2012

I have a list that has alternating item colors.

<s:List id="myList" change="selectionChanged(event)" alternatingItemColors="[0x000000, 0xFFFFFF]" dataProvider="{alResults}" itemRenderer="itemRenders.Results" width="100%"></s:List>

[code].....

View 1 Replies

Flex :: Change Dataprovider In Spark List That Has Itemrenderers?

Mar 13, 2012

In flex 4.5, I have an application that has a BorderContainer that loads a spark list (mxml style - _myList and the borderContainer is stored in a library outside of the parent application) that loads an arrayCollection with an itemRenderer (I should note said itemRenderer is not an inline renderer - on selection of an item in the list, the itemRenderer expands, loads a particular control within the item renderer based on data passed from the selected item in the list) and allows the user to perform a search. This works all well and good on startup/load, until I try to change the dataProvider for the list (my app allows users to switch data sources which then creates a new dataProvider with new variables). I have tried:

[Code]...

View 1 Replies

Actionscript :: Define Multiple ItemRenderers In A Flex List?

Jun 9, 2009

Basically I want to override some function in the flex/actionscript list class which creates a new ItemRenderer and passes it the required data ready to be displayed. I need to do this because I wish to show a different renderer based on the type of data being displayed. Is there such a function?

I don't really want to pass the list a single itemRenderer which calls its addChild function depending on the type of data it has - It just doesn't seem right.

View 1 Replies

Actionscript 3 :: Flex 4.6 Mobile - ItemRenderers And Application Data?

Mar 20, 2012

A question about ItemRenderers: let's say I have an ArrayCollection that is my application data sitting inside a global object. I them populate a sparks list with this data, setting the ArrayCollection as the dataProvider.

So each ItemRenderer gets a copy of an item sitting in the array. You can override the "set data" method to set the data something more domain-specific. The problem is that the data is a copy of the original item.

Now let's say we want to add some data to the item while inside the ItemRender. For example, it could call a method on the item telling it to load some details about itself, or maybe we allow the user to modify something on the item.

Obviously, we can't do any of this if we are operating on a copy because it will be thrown away as soon as the ItemRenderer is destroyed and the original object doesn't know anything about what happened.

So what's the best practice? Should I just use the itemIndex of the renderer to pull out the original item from my global array like this:

{globalArrayCollection}.getItemAt(this.itemIndex) But it seems kind of clunky to me. Is there a best practice for dealing with this?

View 2 Replies

Flex :: Using A Container Powered By Itemrenderers - Make The Rendering Not Stall?

Feb 19, 2010

I'm developing on Flex 4. I have a datagrid container and custom itemrenderer with a text field, a button and a few boxes. Every time some data is displayed, the app stalls for a second or two before rendering completely. Is there any way to make it render more fluidly or render one after another...?

View 1 Replies

Flex :: Value In Datagrid Itemrenderers Set Data Method Doesn't Return The Correct Data?

Jan 10, 2012

I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.

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

without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;

<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........

_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.

View 1 Replies

ActionScript 3.0 :: Fluid Layout Stop Changing Resize Position When Movieclip Is At Certain Position?

Nov 19, 2009

I added a Menu_mc on my stage. Initially, this should be at the center of the stage and when I click on it, it will tween on the upper left corner of the browser. However, when I resize the browser, the Menu_mc goes back to the center of the screen.

I have tried separating a different actionscript file where it is specifically for initialization of the object and another one for resizing. And then when I call it on my main AS file it goes like this:

Code:
// Add the symbols to stage
var Menu_mc = new Menu_MC();
addChild(Menu_mc);

[code]...

But it seems futile.

View 6 Replies

ActionScript 3.0 :: Move The Vertical ScrollBar Position Of The ScrollPane To Top/initial Position

Jun 30, 2009

I am using a ScrollPane in my application(viz., instance name is: myScrollPane). When I view the contents of the ScrollPane, it shows them perfectly. My issue is: When I try to view data present inside the ScrollPane, if I move the Vertical-ScrollBar of the ScrollPane to middle(or somewhere from top to down) and then click on Submit button(viz., instance name is: submit_btn), then its Vertical ScrollPosition must be reset from middle(or any position where we leave it before) to top(or initial position). Hence, I need to move the Vertical ScrollPosition of ScrollPane to top (or) initial position. Everytime, I need to refresh the VerticalScrollBar Position when I click on the submit button. How to do it?

View 1 Replies

ActionScript 2.0 :: Move Punto_mc From Current Position To Random Position After Release?

Aug 29, 2009

how to make an actionscript to move punto_mc from current position to random position after release, and then from this new position to mevo to another randon position after release?

View 2 Replies

ActionScript 3.0 :: Flash - Tweening The Canvas Position While Keeping It's Mask Position?

Feb 3, 2012

I have simple image gallery, where images are placed one next to another and the mask is revealing only one of them. Now I want to tween position of the images, but when I do that the mask is "traveling" alongside with the images..

View 4 Replies

ActionScript 2.0 :: Full Browser Flash - Traced Its X Position And The Var StageXcenter Position And Like Suspected It Shows Different Values?

Nov 12, 2007

So I'm trying my hands on some full browser flash and after reading a couple of tuts I wrote this

Code:
#include "mc_tween2.as"
Stage.scaleMode = "noScale";
stageListener = new Object();[code]...

The trace's are because it didn't work like I thought it would.Etc the middle movieclip didn't center itself but rather positioned itself seemingly how it pleased so I traced its x position and the var stageXcenter position and like suspected it shows different values.

View 2 Replies

ActionScript 2.0 :: Take Button Position Half Width Of Own X Position On Stage

Feb 9, 2011

i want to take btn1 position half wwidth of own x position on stage

View 1 Replies

ActionScript 1/2 :: Get And Set The Scroll Bars Position (pixel Position)

May 5, 2011

I have a ScrollPane and I want to get and set the scroll bars position (pixel position). For example, if the user changes the scroll bars position and then refreshes the page, we need to take the user at the same point where he was before refresh. For this I need to get the respective scroll bars positions before refresh and then set it to the saved position after load. I have got the positions by hPostion and vPosition but now when I try to save the values back to the same properties after refresh it doent work.

View 2 Replies

Actionscript 3 :: Tween Position Relative To Current Position?

Jan 23, 2010

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {[code]....

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

View 1 Replies

ActionScript 3.0 :: Movieclip To Move To The Position Of Each Of Buttons From Any Position?

May 13, 2010

I'm hoping someone can solve this headache. Basically, I want a movieclip to move to the position of each of my buttons from any position along my x axis. Therefore, the movieclip needs to 'flip' to face the way it is traveling.At the moment I have the movieclip moving to the mouse x axis when I ROLLOVER the button and stop following the mouse when I ROLLOUT but the code won't flip the movieclip so I must have something wrong...

btn.addEventListener(MouseEvent.ROLL_OVER,followCa t);
btn.addEventListener(MouseEvent.ROLL_OUT,stopCat);
btn02.addEventListener(MouseEvent.ROLL_OVER,follow Cat);
btn02.addEventListener(MouseEvent.ROLL_OUT,stopCat );

[code]....

View 0 Replies

ActionScript 2.0 :: Mouse X Position To Control Movie Position?

Feb 1, 2006

Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).

View 2 Replies

ActionScript 3.0 :: Setting A Position Of Movieclip Called Red X And Y Position?

Jul 3, 2009

setting a position of movieclip called red x and y position within a movieclip called background

Code:
background.redsquare.x = 300;
background.redsquare.y = 300;

comes up with TypeError: Error #1010: A term is undefined and has no properties.

setting a position of movieclip called red x and y position withen a movieclip called background

Code:
redsquare.x = 300;
redsquare.y = 300;

This works fine but how can that be when surely you must access the red withen the background rather then just accessing red?

View 3 Replies

IDE :: Cursor Position Not Mouse Position In Input Text Box

Nov 12, 2009

I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.

View 8 Replies

ActionScript 3.0 :: Changing Y Position Results In Random Position

Nov 8, 2010

I've run into a new problem, this time with positioning. I've narrowed down the line that's causing it--"block.y = block.y + block.height;" in SetOfBlocks.shiftDown. When I take it out, no problem. But with it in, instead of just dropping each block down by a block height, the affected blocks sometimes move up, and also often move about randomly within the X axis--although their new positions always keep them lined up with the 'grid', which is to say, within multiples of the block height and widths.

[Code]...

View 3 Replies

ActionScript 2.0 :: Tween From One Position To Mouse Position?

Mar 28, 2010

tween from one position to mouse position

View 1 Replies

ActionScript 3.0 :: Z Position Impact On Stage Position?

Jan 13, 2011

I have a sprite that I zoom out using the sprite.z property. Once the z property has been modified the sprite x and Y values do not match the stage x and y real value. So far so good and what I was expecting!
 
What I want to accomplish is that when the user clicks the stage the sprite tweens to where the mouse was clicked but I don't know what x and y position to send to the sprite. ( since stage 200,200 is something like 400,400 for the sprite depending on z value)
 
I tried Utils3D.projectVector using Matrix3D of the perspectiveProjection of the stage without success. (i.e. I get Vector3D(Infinity, Infinity, NaN))
 
I could fallback to scalex/scaley but sprites.z gives me the correct scale, perspective projection, paralax scrolling since I have sprites on different z level all for free. I would have to recode all that.

View 5 Replies

ActionScript 3.0 :: Set That Movieclip X And Position According To Stage Position

Nov 3, 2009

lets say i have a sprite on the stage and one movieclip inside it. now i want to tween or just set that movieclip x and/or y position according to stage position. so for example i want to set mc.y = - 100; (by which i mean -100 to stage, not sprite which mc is in.)

View 2 Replies







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