Flash - Make A Flex/AIR Scroller With An HGroup "snap" To Each Item When Scrolling Completes?

Feb 23, 2011

I'm developing an app for ANDROID devices using Flash Builder Burrito and am having trouble figuring out how to accomplish one aspect of my app.I have an HGroup inside of a Scroller. The HGroup has images that are 400px in width and I have the width of each HGroup column set to 400px. Although the number of items is dynamic, assume I have 10 images in the HGroup. The width of the Scroller and Viewport is set to 400px.

So far so good -- the user can see a single image within the scroller. The user can then scroll left or right using touch or mouse and see each image. But here's where I'm stuck. I want to make it so that when the user STOPS scrolling the scroller then "snaps" an image into view. In other words, I don't want half of one image and half of another image in the viewport.

Seems pretty straightforward but I can't figure it out. Part of the issue is that there doesn't seem to be an event to use for this purpose. I know I can hook in to PropertyChangeEvent.PROPERTY_CHANGE or MouseEvent.MOUSE_UP/TouchEvent.TOUCH_END (which is what I'm doing now) but that event doesn't really give me what I need.

I really need an event that fires when the user releases the mouse as part of the scroll or lifts their finger off the device as part of the scroll. And then I need to wait for the scroll to stop. For example, if I do a really fast swipe I need to wait for the scroller to stop or almost stop before I perform the snap. The event fires as soon as I let go of the mouse or take my finger off the tablet, so if I alter the horizontal scroll pos then it gets overwritten by the "slowing down of the scroller".

By the way, I know I can use modulus logic to show each image "whole". That's not where I'm stuck -- I'm stuck at which event to use to know WHEN to perform this mod logic.

Note that what I've already developed works just fine if I slowly scroll and then let off the mouse. It's only when you slide more rapidly that it ceases to work.

Here's my partially working code:

private function onVehicleScrollerMouseUp(event:Event):void
{
snapScroller();
}

[code]....

View 2 Replies


Similar Posts:


Flex :: Changing The Position Of A Scroller Container Programmatically (by HGroup Index)

Feb 10, 2012

I am trying to change the visible index of a Scroller container on an event. The Scroller contains an HGroup with Images, so on an event I want to change which of the Images is visible in the Scroller by specifying an HGroup index. Is this possible?

[Code]...

View 1 Replies

Actionscript 3 :: Obtaining A HGroup Subcomponent That It Is In View Of A Scroller Container Adobe Flex 4.5

Feb 1, 2012

I have setup a Scroller container around an HGroup of labels. The Scroller is setup to only display a single label at a time. What I am trying to do is determine which label is in view of the Scroller when a button is clicked. I have scoured the reference material on Scrollers and HGroups, but cannot formulate a programmatic strategy to determine what element of the group is in view.

[Code]...

View 2 Replies

Flex :: Event When The Scroller Starts Scrolling Or Ending Scrolling In 4.0?

Feb 10, 2011

are there any events that the scroller will dispatch when being scrolled?

View 1 Replies

Flex :: SparkDataContainer Scroller Not Scrolling To Bottom Of Container?

Mar 29, 2010

I am using a scroller component within a custom skin for a SkinnableDataContainer. I am running into an issue in that the thumbbar of the scroller stops at about the 50% point, however this is actually the end of the scrollable area. In actuality, the thumbbar should be at the bottom of the scroll track. Here's the code for the scroller:

<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" bottom="150" >

[Code].....

View 1 Replies

Flex :: Scaling An Image In A Scroller Resizes The Scroller When Relative Dimension Are Set To The Scroller?

Mar 9, 2010

I would like to position relatively a scroller in my application like below.When I scale the image, I resize the scroller...

<s:Scroller width="50%" height="50%" >
<s:Group>
<mx:Image

[code].....

View 2 Replies

Flex :: AIR: Make Taskbar Item Flash?

Feb 18, 2010

Is there a way to make the taskbar item flash in an AIR app? like it does in otherapplications to alert the user of a change.

View 1 Replies

Flex :: Group - SkinnableContainer As HGroup?

Nov 30, 2011

I have a SkinnableContainer class called: 'GroupNavCustomContainer' that uses a skinClass called 'GroupNavCustomSkin'. The GroupNavCustomSkin is the default one Flex creates for you: (The default skin class for a Spark SkinnableContainer container). Now, I have to add buttons to the GroupNavCustomContainer dynamically from outside the class which is not a problem. However, I can't seem to figure out out to make my skin behave as a HGroup so the buttons are spaced evenly. I tried: modifying the Group container to no avail:

[Code]....

View 1 Replies

Actionscript 3 :: Use HorizontalGap In The HGroup In Flex 4.5?

Dec 29, 2011

How can I use horizontalGap in the HGroup in Flex 4.5? This function doesn't exist in the flex 4.5 like flex 3.

View 1 Replies

Flex :: Hide Hgroup On Condition

Mar 6, 2012

i have my hGroups as like [code]and i m trying to hide the hgroups on a condition when this bean tagInfoData have a value "notworking" otherwise it will shown..should i need to write code in the creation complete as all this is in a pop up window of the button click event.[code]

View 1 Replies

Flex Align A Image To The Rightmost Of The HGroup?

Jun 9, 2011

Is there a way to align an image to the rightmost of HGroup, which is setted to 100% width ?

here is my code, but it aligning the image "imageZoom" just after the object before it :

[Code]...

View 1 Replies

Flex :: Use VGroup Or HGroup In Pure Actionscript3?

Sep 3, 2011

I'm developing a flash app by using free Flex SDK and text editor and compiling in command line.

I want to use VGroup or HGroup in my actionscript to manage positions of DisplayObjects.[code]...

View 1 Replies

ActionScript 2.0 :: Make Picture Fade After Interval Completes?

Sep 30, 2009

I want the part labeled fade to happen after the interval completes. Right now it does it right away.[code]...

View 1 Replies

Flex :: Cannot Move Custom Component Based On HGroup

Oct 30, 2011

I have created a custom component based on spark.components.HGroup and it works mostly as needed, but I have this minor problem: I can not move it.

Maybe someone will look at my simplified test case below and spot my error?

Here is the screenshot of my 3 custom components, representing chat bubbles:

Here my custom component Bubble.mxml drawing black text on green background:

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

[Code]....

View 1 Replies

Actionscript 3 :: Scrolling Spark List Without Scroller Bar?

Oct 16, 2011

How to scroll Spark list with a disabled scroller bar? I created two buttons to scroll up and down, but it is unclear what methods can be used to scroll the list.

View 1 Replies

ActionScript 2.0 :: Dynamic Text Scroller Scrolling?

Dec 3, 2005

i made a dynamic text scroller and it is too choppy

on (press, release, keyPress "<Up>") {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)>1) {

[code].....

View 2 Replies

ActionScript 2.0 :: Scroller Only Scrolling When It Gets To The Bottom Of The Path?

Jul 17, 2004

I'm having trouble with my scroller only scrolling when it gets to the bottom of the path.
This is from the tut on this site http:[url]...Here is the actionscript I have for each mc:

//textbox (height=300 width=250):
onClipEvent (load) {
loadVariables ("text.txt", "");[code]...

View 3 Replies

ActionScript 2.0 :: Scrollbar - Scroller Only Scrolling When It Gets To The Bottom Of The Path

Jul 17, 2004

I'm having trouble with my scroller only scrolling when it gets to the bottom of the path. This is from the tut on this site [URL]. Here is the actionscript I have for each mc:

[Code]...

View 3 Replies

Flex ::make 3 Combobox Selected Item?

Jun 4, 2011

I have a combobox with arrayCollection dataprovider, it selects nothing at start, but i see the first object label as selected, i want to add select text, as first option that selects nothing, just to indicate that the user didn't select an option yet.

View 1 Replies

Actionscript :: Flash - Make An Object Snap To Another Object Then Follow Its Path?

Apr 15, 2011

I am currently trying to create an app using flash AIR.I would like to find some more information on how to make an object snap to another ojbect then follow its path, eg. a person object is already on the stage, then drag an arrow to the object which snaps to it, then on play button it follows the arrow path. all in pure actionscript, no guide layers.

View 1 Replies

Actionscript 3 :: Make An Item In A Flex List Control Not Selectable?

Jan 12, 2010

Is it possible to make an item in a List control not selectable? If so, how would this be accomplished?

I've tried one thing so far. What I did was use a custom item renderer that checks for a value in the data property upon a FlexEvent.DATA_CHANGE event. If that value is not set, I tried setting the item renderer's selectable property to false. This, unfortunately, does not seem to work.

View 4 Replies

Flex :: Make SelectedIndex Correspond To Selected Item In ComboBox?

Jun 21, 2010

Isn't there a better way to accomplish this?[code]...

All I want to do is make sure that when I update the item that the comboBox is pointing to internally, that it's selectedIndex also update so that the label within the ComboBox reflects the new value.

View 1 Replies

Make An Item Editor In Flex List Component Commit It's Changes?

May 19, 2009

I have a list component and I have an item editor for the items in the list. I would like to have a button that the user clicks once they are done with their changes because I am having them edit multiple pieces of data in the editor and I would also like to validate the data before closing the editor as well. I just don't know what to do on the button's click event to make the item editor close and commit it's changes to the data provider.

View 3 Replies

Actionscript 3 :: Spark - Manually Scrolling A Element Wrapped Inside A Scroller Window

Jun 21, 2011

The answer to my question is possibly easy, yet I haven't found an example of solving it in the web, nor have I found a solution reading ActionScript reference. My problem is the following: I have a big UIComponent derivate element inside a Scroller (spark.components.Scroller) window. The Scroller class is great because when my canvas element, that changes size dynamically, exceeds its boundaries, scrollbars appear automatically and handle scrolling of my UIComponent inside it. However, I'd like not just to be able to Scroll using these automatically appeared scroll bars, but also by using a pan tool that I will myself implement (similar to the hand tool in Adobe software, for example). The thing is that I am not able to modify correctly the element's position inside the Scroller window.

I tried, as a first approach, accessing to my elements' 'x' and 'y' properties, however, when changing them, I dont get the resulkts wanted. The code for it is the following (in which, for symplifying reasons, I used a text label as my 'inside' element, and two buttons as an external scroll controller, instead of a hand tool)

[cODE]....

View 1 Replies

IDE :: Make Snap Object On The Mouse Movement

Jun 24, 2009

make snap object on the mouse movement. As, I have made the code but getting issue on removing from snapping. I have attached the file. you can look in the [URL]

View 1 Replies

ActionScript 3.0 :: Make An Object Slide Or Snap?

Nov 7, 2010

I'm having trouble figuring out the code to make an object slide or snap.

I.e. imagine a checkerboard. I want it to be able to move only horizontally or vertically, from any square. But I also want to make it feel smooth like sliding (i.e. not just snap from square to square).

View 2 Replies

ActionScript 3.0 :: Activate The Browser Scroller With A Site Make Full In Flash?

Mar 9, 2012

[URL]make fully in flash, can interact with the brwoser size (try to resize the windows and see what happen). I thought that it isn't possible, but i unserstoond that i was wrong after saw the louis vuitton site.. Then how i can activate the "browser scroller interfacing" with my swf?

View 2 Replies

ActionScript 3.0 :: Make Vertical Text Content Scroller Working In A Flash

Jul 26, 2009

I've tried for hours and days to make my vertical text content scroller working in a flash fake 3d environment with rotationX / Y. But because of vector>bitmap conversion when 3d roationing, the scroller fails to works. I know the stratDrag method fails to work in a 3d environment. other than using PV3D or so ? cause I don't know how to work with PV3D, it's just tooooo complicated to get it for me.

View 1 Replies

ActionScript 3.0 :: Make A Draggable Object Snap Into Place?

Jul 23, 2010

I'm new to Flash (sort of - I used it a bit back in 1999-2000, but it's changed a LOT since then). I'm making an educational game for my company that involves dragging labels from a word-bank to their correct position on a diagram. I want the kids to be able to drag any one of the five labels and move them to any one of five marked positions on the diagram. I'm using Flash CS5 with Actionscript 3. I used code snippets, so that each individual label has the following code associated with it:

[Code]...

View 22 Replies

ActionScript 2.0 :: Make MC Snap To Specific Position Once Dragged?

Jun 2, 2011

I am creating an exercise to teach the meaning of the word "take". I want draggable objects (MC's) which will automatically snap to a different position when they are dragged a little way.

This is the code I am trying (not mine I'm afraid). I have it on the same frame as the MC in "Actions - movie clip". The MC is draggable but doesn't snap.[code]...

View 3 Replies







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