Flex :: Put Images On A Canvas And Have Them Be Moved Around By The Mouse?

Jan 11, 2010

I want to dynamically create and put some Image (mx.controls.Image) objects on a Canvas and I want them then to be able to be repositioned by the user via the mouse. Can this be done? Note, I am not looking for drag and drop. I just want to change the X and Y coordinates of Images with the mouse.

View 3 Replies


Similar Posts:


Flash - Flex Canvas With Many UIComponents If One Moved Are Others Redrawn/reprocessed?

Jul 18, 2010

I have a canvas called Host with many UIComponents as children, sometimes up to 1000 or 3000 items. This is fine for now, as they are not interactive. But, I have added a 'marker line' (a 1 pixel wide UI Component with a colored background) to the canvas which follows the mouse movement. When this UIComponent is added to the Host canvas and moves, everything slow down to a crawl i.e. takes ages for the UIComponent to move.

View 2 Replies

Flash :: Canvas Moved On StartDrag() Without Calling Set X / Y Or Move() - How Does StartDrag() Exactly Work In As3 / Flex

Feb 11, 2011

i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.

i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?

View 3 Replies

Flex :: Persist A Hyperlink's Style After Mouse Has Moved Away?

Oct 17, 2009

Is it possible to persist the look of a 'hovered' hyperlink even after the mouse has moved away from it? I want to keep the user's attention on the hyperlink -- or at least have them able to see what it was, standing out from the rest of the text -- for a few seconds after they've left it. Ideally it would fade slowly back to normal

View 1 Replies

Flex :: Placing Images Into A Collage Canvas?

Apr 28, 2010

I've got an array of different sized images. I want to place these images on a canvas in a sort of automated collage.

All my images have heights divisible by 36 pixels and widths divisible by 9 pixels. They have mouseDown functions that allow you to drag and drop. When dropped the image goes to the closest x point divisible by 9 and y point divisble by 36. There is a grid drawn on top of the canvas.

I've sorted the array of images based on height, then based on their widths.

imagesArray.sortOn("height", Array.NUMERIC | Array.DESCENDING);
imagesArray.sortOn("width", Array.NUMERIC | Array.DESCENDING);

I'd like to take the largest image ( imageArray[0] ) to put in corner x,y = 0,0. Then randomize the rest of the images and fit them into the collage canvas.

View 3 Replies

Flex :: Detect When Mouse Leaves A Canvas

Jun 17, 2011

I am trying to detect when the mouse leaves a canvas. I know about the MOUSE_LEAVE, but this seems to only be valid for the stage, not Canvas objects. P.S. I have tried the mous-out, but, for some reason, that event keeps getting triggered everytime I move the mouse. I should probably point out that I have used the Mouse.hide() and replaced the cursor with a custom cursor.

View 3 Replies

ActionScript 2.0 :: OnPress Doesn't Work If The Mouse Button Is Pressed Again But The Mouse Is Not Moved?

Jul 26, 2006

I have a very simple piece of code but it has one very annoying bug. When I press the button a second time, the code doesn't work. The only way to get the code to work is by moving the mouse a tiny bit, or moving the mouse off the button and back on. make a button that can be clicked many times without moving the mouse?

Code:
randommultiquiz.onPress = randommultiquizOnPress;
function randommultiquizOnPress() {
_root.attachMovie("connect", "newconnect", 200);
newconnect._x = 0;

[code]....

View 9 Replies

ActionScript 3.0 :: "mouse Off Canvas" - Go To Frame2 When The Cursor Leaves The Canvas

Feb 24, 2011

Basically I want to go to frame2 when the cursor leaves the canvas. The code below contains no errors when tested but it still does not work.

[Code]...

We know that the function gotoAndStop(frame2); works in multiple situations which means the first 3 line is fine. I don't know if the problem is the MOUSE_LEAVE event or this.stage which i suppose is the identifier for the canvas. I sure that there must be an alternative code for the identifier this.stage or the whole code. Any solution on how to fire the given function in the event when the cursor leaves the canvas?

View 2 Replies

Flex :: Give MS Word Like Interface To User To Expand Or Contract Display Object's Like Canvas, Images

Dec 9, 2009

How to give a ms word like interface to a user so that he can enlarge and contract the display objects like Images, canvas, Hrules etc. at runtime in an web application?

View 1 Replies

Flex :: Dynamically Add Different Items To ThumbContent Canvas And Use Scroller Canvas To Scroll

Jun 5, 2009

I have the following code in my flex project.

[Code]...

I want to dynamically add different items to thumbContent canvas and use scroller canvas to scroll. I see than the height of thumbContent bigger than 7977 it truncate from scrolling. So - I see the scroller canvas with empty space on top. Then I scroll to bottom - I see the content of thumbContent and at bottom scrolling I see empty space too.

View 1 Replies

Flex :: Skin A Canvas With Image And Scale It To Size Of Canvas In It?

Apr 9, 2011

I'm trying to skin a canvas with an image (which is essentially a custom border for the canvas). I've been trying the backgroundImage style as well as the borderSkin style. I can't get the image to scale to the full size of the canvas though. I was wondering what the best way to go about this is.[code]...

View 2 Replies

Flex :: Add Child On Canvas And Set It "on-top" When Clicking Mouse?

Nov 21, 2010

I need to add an UIComponent (Label for example) as a child on a canvas and I need to set it on-top (when user click on the label with the mouse, the target event will be the label and not the canvas)I'm sure flash has a solution for that but I can't find it on the net.

View 1 Replies

ActionScript 2.0 :: Detect When The Mouse Has Moved Upwards Or Downwards?

Feb 18, 2009

Is there any way to detect when the mouse has moved upwards or downwards?

I currently have a mouse listener with an onMouseMove function that uses the _ymouse to detect any movement within a restricted distance.

But I want the mouse to detect up and down movements in any distance.

View 2 Replies

ActionScript 3.0 :: Mouse Is Moved Over A Movieclip (mcHitArea) On The Stage?

Aug 2, 2010

I have a simple flight simulator animation. When the mouse is moved over a movieclip (mcHitArea) on the stage the code below moves 2 indicator lines as well as 2 jet images and the background. The problem is that when the mouse runs off, say, the left side of mcHitArea, that mouse location is recorded. Then if the mouse is brought back in from the other side of mcHitArea the images are rotated way off course. These images never come back to center.

[Code]...

View 1 Replies

ActionScript 2.0 :: Registering Whether Mouse Has Moved So That Can Create A Screensaver

Jan 4, 2012

I'm basically looking to create a screensaver within the flash file i'm using. So if the person doesn't move the mouse for say a minute, actionscript will detect this and play a movie ( screensaver type one )It's within a digital application and the client wants a built in one rather than making a proper one.

View 4 Replies

ActionScript 3.0 :: Play Random Videos After 10 Seconds If The Mouse Has Not Been Moved

Mar 27, 2011

I want to play random videos after 10 seconds if the mouse has not been moved. I am getting this error:

[Code]...

View 10 Replies

ActionScript 2.0 :: CS3 - .onMouseMove - Make A Portion Of A Site That Is Stimulated From The Mouse Being Moved

Nov 30, 2009

I would like to make a portion of a site that is stimulated from the mouse being moved. So, as the user moves their mouse I want the timeline to change (for an image will load on each new timeline). So, it will be kind of like a flip book that is activated by the mouse moving. Hopefully that makes sense. Each scene a person will be moving (new picture in a new frame) as the mouse moves up or down.

[Code]...

View 6 Replies

ActionScript 2.0 :: Moved Mouse / Clicked Other Button / Pages Do Not Load As Expected

Nov 14, 2010

The page transition work fine after Respected tacos " changed the code but while transition between the pages if I quickly move the mouse and clicked the other button the pages do not load as expected.I tested several times and with lower frame rates this problem can be watched.

View 7 Replies

ActionScript 2.0 :: How To Stop Motion - Rest / Settle At The Position Until The Mouse Is Moved Again

Apr 7, 2008

i have a fish that follows the mouse position. Im working out the angle and distance it is from the mouse cursor and telling it to swim in that direction. But when he gets there he flickers back and forwards. How can i get him to rest/settle at the position until the mouse is moved again.

[code]...

View 3 Replies

ActionScript 3.0 :: Draws A Couple Of Lines With Changing Alpha And Width Whenever The Mouse Is Moved?

Apr 23, 2009

I have wrtitten some code that draws a couple of lines with changing alpha and width whenever the mouse is moved. I need to convert this code to AS3 so that I can use it in conjunction with some video tracking.

Code:

var speed:Number = 100;
var myNumber:Number;
var myMax:Number = 50;[code]...

View 1 Replies

Hiding Images Outside The Canvas?

Jul 9, 2009

whenever I publish a FLA file I have, and load it onto a website, I see elements which aren't suppose to be within the frame sitting outside the frame.These elements are outside the canvas in flash and come in for brieft flashy moments but then fly back out again.How do I hide all files outside the canvas? I tried masking the top layer and adding everything underneath it and locking it but that never worked.

View 3 Replies

IDE :: Adding Multiple Cliparts/images To Canvas?

Apr 2, 2009

I am working on application similar to [URL] how to add multiple clipart to the center rectangle. I can add one clipart but then adding second clipart/image replaces the first one.

View 1 Replies

ActionScript 2.0 :: Drawing API - Draw Rectangle By Dragging Mouse On Canvas

May 10, 2005

I need to to incorporate a functionality where the user can use his mouse to draw a rectangle by dragging his mouse over the canvas - much like the Rectangle Drawing Tool in the Flash Authoring environment. The requirement is something like a rubberband tool where the user can define a portion of a map by drawing a rectangle over it. The coordinates needs to be captured.

View 1 Replies

ActionScript 2.0 :: Drawing API - Draw Rectangle By Dragging Mouse On Canvas?

May 10, 2005

I need to to incorporate a functionality where the user can use his mouse to draw a rectangle by dragging his mouse over the canvas - much like the Rectangle Drawing Tool in the Flash Authoring environment. The requirement is something like a rubberband tool where the user can define a portion of a map by drawing a rectangle over it. The coordinates needs to be captured. Can anyone help me with the actionscript.

View 1 Replies

Flex :: Run ClickHandlers On Buttons Moved From Main View Component To Header Bar?

Jun 7, 2011

I've used JRab's example here [URL]... to add a header menu to my app. What I'm having trouble with is executing my functions from the header mennu. For example, my firstView is appHome.mxml. It instantiates a Canvas object that has an erase(). There is a button in appHope.mxml that executes the erase() on the Canvas instance. I'm trying move the Erase button out of my appHome.mxml and into my headerMenu.mxml but don't know how to execute the erase() on the Canvas instance. The first thing I thought to try was click="{appHome.myCanvas.erase()}" but obviously that didn't work.

I asked a similar question yesterday here: Flex executing a function on another view and I accepted the answer before I tried it. The problem is that the headermenu.mxml is not a child of appHome.mxml. They are both children of the main app.mxml. Secondly, the object that has the erase() is in a separate .as class I instantiate in appHome.mxml.

View 1 Replies

Flex :: Events - Drag & Drop: Detecting When All Data Has Been Moved From Source To Destination

Oct 5, 2009

I have two mx:TileList controls that I'm using to allow editing of objects in batch. The first contains a collection of all available data, and the 2nd contains the current batch. Both are bound to ArrayCollections, and using the native drag-n-drop functionality of the TileList control the data is moved from one ArrayCollection to the other when an object is dragged between them.

I need to change the currentState to show & reset the batch manipulation controls when the batch count goes from 0 to n or n to 0 items. Based on the documentation, I would have thought that I should listen to the dragComplete event, but my testing shows that instead of firing after the data has been removed from the source ArrayCollection and added to the destination ArrayCollection, it fires (consistently) between these two actions.

[Code]...

View 2 Replies

ActionScript 2.0 :: Mouse Scroller - Images Won't Move Depending On The Mouse Movements

Jan 12, 2011

I am creating mouse scroller and when I insert actionscript my images wont move depending on the mouse movements..I am using Flash cs5 and Actionscript 2.0...this is my actionscript:

[Code]...

View 9 Replies

Actionscript 3 :: Flex - Possible To Have Flex DataTips On Canvas Rather Than Chart Objects

Jan 17, 2010

Flex charts, like AreaChart, have wonderful built-in support for displaying data "tool tips" when a user hovers over a point supplied in the data of a graph. You can hover over any of the bar graph examples on this page for a demonstration. I have a graph situation where I optionally draw in some dots as reference points on CartesianDataCanvases supplied to my AreaChart through it's <mx:annotationElements> and <mx:backgroundElements> tags.

I would like to have the same hover data-tip functionality that the AreaChart has, but applied to these dots. I realize that I am just drawing on canvas, and that no actual dataProvider supports these dots, but if there was a way to supply the CartesianDataCanvas with an array of data values or something to that effect,

View 1 Replies

Flex Get Canvas Id?

Jan 20, 2010

I'm developing an engine to generate components.I been wanting to get my xml script that read and create a component to be load into 'content' canvas. I not sure how do I get the addChild work correctly as in 'content'.addChild instead of the one shown below:[code]

View 1 Replies

Flex :: Scroll A Canvas Up?

Dec 27, 2009

The basis for the chat window is a canvas. I've got that showing, but how do I make it scroll up? I want to clip the window so only the last 15 lines are shown.[code]...

View 1 Replies







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