Flex :: Why Do DragOver / Enter Events Require A Background On Canvas

Dec 10, 2009

I have a canvas which I want to accept drags on. I have added a dragOver and dragEnter event listeners to the canvas, but they only work if I drag over something inside the canvas (another child element). I realised that if I set the canvas' background colour to black it works. So I have set it's background transparency to 0, which works... buy is there a better way to work around this apparent need for the canvas to have something inside it to accept dragEvents.

View 1 Replies


Similar Posts:


ActionScript 3 :: Empty Space Of Canvas Does Not Fire Events In Flex

Dec 6, 2011

The empty space of a canvas does not fire events. My problem is I have a canvas in an application that shows a diagram consisting of different figures, but the canvas empty places do not trigger the events that I need, as the rollover. How I can make my canvas trigger events even in the empty spaces? I have set the background Color, mouseEnabled, color, border, alpha, opaqueBackground, etc, and nothing works. I'm using Flex 4, and I have to use only a mx:Canvas.

Here is the event listener registration:
canDiagram.addEventListener(MouseEvent.ROLL_OVER, function(event:MouseEvent):void{if(actualCursor != null){CursorManager.setCursor(actualCursor,2,-10,-10);}},true);
canDiagram.addEventListener(MouseEvent.ROLL_OUT, function(event:MouseEvent):void{CursorManager.removeAllCursors();},true);

View 2 Replies

Flex :: How To Set Bitmap Grid As Background For Canvas

Jun 12, 2009

I've got a canvas in my app which I want to be backgrounded with a grid. I suppose, I need to create a DisplayObject with a single grid cell drawn on it and set it as a repeated bitmap fill for the canvas, but I can't figure out how to do that.

View 2 Replies

Actionscript 3 :: Design Pattern To Require Multiple Events Before Executing Method?

Aug 23, 2011

There are many times that I've needed to execute some code after a number of events have fired, and I've come up with counters and such but I feel there must be a better way.For example, say five files need to be loaded, after which a UI component will become active.If I set up a counter that increments each time a file is requested, then decrements each time one has loaded, I run the risk that the first two or three files may somehow get completely loaded before my code gets around to requesting the fourth and fifth, which would mean that my counter would be at zero when I still have two files to load, thus allowing the UI component to be prematurely activated.

There are some cases where you could know the number that need to be loaded before the requests go out, but it's possible that the first file contains the paths (and therefore the number of) files.And this file-loading scenario is only an example of the pattern I'm trying to explain.)

View 4 Replies

Flex :: Listen To Mouse Events On The Background Of A Group?

Aug 2, 2011

Is this the most efficient way to listen to mouse events on the background of a group?

<s:Group width="200" height="100" rollOver="group1_rollOverHandler(event)" rollOut="group1_rollOutHandler(event)">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor alpha="0"/>
</s:fill>
</s:Rect>
</s:Group>

seems pretty minimal, but alpha = 0 is not the most efficient thing out there.

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

Actionscript 3 :: Set Bitmap Image In Canvas Background?

Nov 18, 2010

I have image as Bitmap:

var bitmapImage:Bitmap=getDefaultImage();

I need to set this bitmap as canvas backgroundImage.

I find method myCanvas.setStyle("backgroundImage",url); But i dont need url. Whent i do this:

myCanvas.setStyle("backgroundImage",bitmapImage); I have an error.

How to set bitmap image in canvas background?

View 1 Replies

Actionscript :: Retriving Alpha Value Of Canvas Background?

Oct 19, 2011

Can we fetch the alpha value from a canvas( i have a canvas in flex, setting background color with alpha, can i read the alpha from the canvas directly again later ? ) for example we can read the background color like canvasId.getStyle(backgroundColor) same way, any method for alpha as well?

View 1 Replies

ActionScript 3.0 :: Flash Enter Frame Events On Optimisation?

Mar 7, 2011

Lets say I am working on some basic shooting game that involves lots of moving enemies. The enemies all come from one class that extends movieclip.

I want the enemies to move 10px downwards every frame. At the moment I know of two ways of doing this:

The first is to run a single onEnterFrame function on the main timeline, this function loops through all of the enemies on the screen calling a function in the enemy class that contains "x+=10".

The second is to put the onEnterFrame function inside the constructor function of the enemy class that would then contain the "x+=10".

Both give the same result but is one less work for the computer than the other? The first has a big loop that accesses all of the enemies, the second has an "onEnterFrame" running for each of the enemies.

View 6 Replies

ActionScript 3.0 :: Choosing Background Image From File On Server As Canvas

Nov 28, 2010

I need the exact simple application but the ability to choose a background image from a file on the server as the canvas and I want to save the created image on a server file instead of on the client machine. The ability to change the pencil drawing size would be an additional plus. I work with php and mysql so I would like to use them to store the file parameters, even as a blob in mysql, along with some additional user (server) defined variables (I can do the php/mysql side if I can get the file there, I understand there is an swf to png ByteArray class that might be able to save on server. The project is for an opensource group so the final product would need to remain as such, I would be able to pay for the modifications mentioned above. The source files are available at the links below. [URL]

View 1 Replies

ActionScript 3.0 :: [CS4] Embed Fonts Require Flex?

Aug 4, 2010

I have been trying to embed fonts for a program for the last couple of days. I have found many places that explain how to do it, but none of them have worked. I am wondering, do I have to use Flex SDK to embed fonts?I need to embed 18 fonts in a program, and I have even tried adding 18 textFields off of the stage, each with text in one of the 18 fonts and embeding the fonts via the properties panel. That doesn't seem to work either

View 2 Replies

Flex :: Require A Function Parameter To Be A Static Constant Of The Function's Class?

May 22, 2009

Let's say I have a Custom Event Class, and it has several Event types stored in static Constant:

[Code]...

Is there an easy way to validate that the type passed to the Constructor is one of the Static Constants of the Class, without having to check it against each value?

View 5 Replies

ActionScript 2.0 :: CS3 How To Alpha Out Movieclip On DragOver

Aug 24, 2009

I posted last week on the topic of getting movieclips to lock into place after you have dragged them in the correct location. Luckily I was able to figure it out by myself, love when that happens.

Anyway, I have a new issue. What I want to do is have a movieclip alpha to 0% when another movieclip is dragged over it. I want to it to happen by 25% each dragOver though. So it starts at 100% then the user drags over and the alpha is at 75% now, then another drag over and 50% etc...

The MC that is being dragged is called ragMC and the one that is alpha'd out is greaseMC.

View 2 Replies

ActionScript 2.0 :: RollOver Conflicting With DragOver?

Nov 24, 2008

I'll admit that I'm a scripting novice. So I'm having trouble with some onRollOver, nRollOut, and onDragOver in some code of mine. It's an XML driven menu I borrowed from a tutorial. It allows you to drag items into any order. Anyway, I've tried to implement a movieClip that is visible when you RollOver as well as a seperate movieClip that is visible onPress and onDrag. The code may be too ambiguous but maybe not. I'm at my wits end. Starting to thrash code around. What I'm aiming for is movieClip that appears when you rollOver and goes away when you rollOut. And a movieClip that stays visible when you hold and drag the item around.

[Code]...

View 1 Replies

ActionScript 2.0 :: Rollover Works, DragOver Doesnt?

May 18, 2010

I have the raster of dots on white background. I would like it when i DragOver EACH DOT it becomes white so it looks like you are actually drawing white line by erasing the dots. Ive somehow found the way how to do it by making it transparent when I rollover.But it doesnt work with dragover. Does anyone knows how to do it only when i hold down the mouse button and drag my mouse over the dots?his is the script assigned to MC with one black dot (I copied this MC with one dot into another MC and multiplied it to have the raster):

this.onRollOver = function () {
this._alpha = 0;
}

[code].....

View 1 Replies

ActionScript 2.0 :: Use DragOver, DragOut ,rollOver,rollOut?

Sep 16, 2009

I have the following fla that you can download it.I want to make use also by on handler event for on(dragOver),on(dragOut),on(rollOver),on(rollOut).I don't know how can I use those 4 situations to continue my example.

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

ActionScript 2.0 :: Flash8 : Making A Simple Randomness Game - Use The On(dragover)?

Dec 16, 2009

How do i use the on(dragover), becuase i am making a simple randomness game,(to start off) because i have something that you can drag, and i want to make it if you drag the thing over it it takes you to a new keyframe.Here is the movie clip i want to be drug on: (nothing happens)

Code:
on(dragOver) {
gotoAndStop(3)
}

Heres the code that you can drag the item(works)

Code:
on(press) {
startDrag(this)[code].....

View 1 Replies

ActionScript 2.0 :: DragOver - Drawing White Line By Erasing Dots

May 19, 2010

I have the raster of dots on white background. I would like it when I DragOver each dot it becomes white so it looks like you are actually drawing white line by erasing the dots. Ive somehow found the way how to do it by making it transparent when I rollover. But it doesnt work with dragover. How to do it only when I hold down the mouse button and drag my mouse over the dots?

This is the script assigned to MC with one black dot (I copied this MC with one dot into another MC and multiplied it to have the raster):
this.onRollOver = function () {
this._alpha = 0;
} this.onPress = function () {
this._alpha = 50;
}

I've tried also this, but it doesn't work:
var erasepoint = false;
this.onMouseDown = function(){erasepoint = true;}
this.onMouseUp = function(){erasepoint = false;}
this.onRollOver = function () {
if(erasepoint){
this._alpha = 0;
}}

View 6 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 :: After Importing A PNG With Transparent Background It Shows Up With White Background

Dec 28, 2010

As the title already states i have a (big) problem importing a PNG in a Flex 4 application.Created a PNG file in Photoshop with transparent background. Loaded in Flex application using this code:[code]So when the complete event fires the data has been loaded and it is possible to assign the data loaded to the image component named Thumbnail:[code]Unitls now everything works as expected!But when i try to send the Thumbnail component's data to a WCF service i receive a photo with white background:[code]

View 2 Replies

Trace A Text If The Mouse Is Pressed (MouseDown) And Is It's On A Movieclip (DragOver,RollOver)?

Apr 5, 2009

I want to trace a text if the mouse is pressed (MouseDown) and is it's on a movieclip (DragOver,RollOver)...can't manage to put all the 3 condition allong for the script to work...

View 1 Replies

Actionscript 3 :: Flash : ENTER Does Not Get Detected But CTRL+ENTER Works Fine

Jun 23, 2011

When my focus is inside the input text field, pressing CTRL+ENTER works but ENTER does not.Pressing Enter when my focus is anywhere BUT the input text field works just fine..My intention is to detect if ENTER key was pressed after the user fills out the field, but it seems to only work for CTRL+ENTER

ActionScript 3:

// works:
stage.addEventListener(KeyboardEvent.KEY_DOWN, enterHandler);
// ignored:
email.addEventListener(KeyboardEvent.KEY_DOWN, enterHandler);

[code]....

ENTER results in charCode == 0, whereas CTRL+ENTER is charCode == 13 email was created using the Text tool and set to "Editable"

Note: I am testing in Chrome and Firefox running Flash v10

View 1 Replies

Actionscript 3 :: Write An Adapter That Maps All The LinkedSetFx Events To The Expected Flex Collection Events(As3Common-collection)

Aug 25, 2010

LinkeSetFx has its own CollectionEvent, but I don't know how to map the LinkedSetFx event to mx.events.collectionEvent(I want use it in ComboBox). LinkedSetFx is in AS3Commons-collection framework.Here is the url, choose the as3commons-collections-1.0.0.zip, you'll find LinkedSetFx in srcorgas3commonscollectionsfx

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

Aligning The Canvas To The Right In Flex?

Dec 8, 2010

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas width="100%" height="100%">
<mx:Canvas backgroundColor="#A8A8A8" height="100%" right="0" top="0" width="100">
</mx:Canvas>

[Code]...

My code above works absolutely fine, until i resize my browser window to a size below 800px width. When the browser window is make of lesser width than 800px, the canvas with background color #A8A8A8 is on the right of the window, but the problem is, when I move the scroll bar, the canvas should remain on the right of the window. Which does not happen, and that is what my problem is.

How can I solve this issue. What should I do to keep my canvas be on the right=0 all the time.

View 1 Replies

Flex :: Lie Two Canvas At One Tab Navigator?

May 18, 2011

I want to lie two canvas at one Tab Navigator. when I use <mx:local it created multiple tab.

View 1 Replies

Flex :: Drawing Squares On Flex Canvas?

Dec 23, 2009

I'm trying to write some code to an animated images of squares on a Flex Canvas There's something wrong with my code below because it becomes progressively slowerI assume I'm supposed to clear the old squares or something.What am I doing wrong below?:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();">
<mx:Script>

[code].....

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







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