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


Similar Posts:


Flex :: Have A Button Not Fire On Space Key If It Has Focus?

Jun 11, 2009

The behavior I'm trying to prevent is after a user clicks on a button, the button retains focus, and then if the user hits the space key, the button fires again. So I thought it could be solved either by setting the focus elsewhere, or by having the button ignore the space key. I've tried adding the following keyDown event listener on the button, but it didn't work.

private function btn_keyDown(event:KeyboardEvent):void {
// try to ignore spaces, i.e. don't click on SPACE when it has focus
if (event.keyCode == Keyboard.SPACE) {
}
}

I tried changing focus by doing the following, at the end of the function that's called when the button is clicked:

stage.focus = parent;

View 5 Replies

Flex :: Events - MouseEvent Doesn't Fire When Mouse Stays Over Element

Apr 23, 2010

i'm trying to make a scrollable box, when a mouse enters and STAYS on "wrapper"'s area, "pubsBox" moves 10 pixels to the left.

<mx:Canvas id="wrapper" height="80" width="750">
<mx:HBox id="pubsBox" horizontalGap="10" height="80" width="100%" />
</mx:Canvas>

My problem is that I'm not sure how to make the MouseEvent.MOUSE_OVER work, to recognize that the mouse is still ON the area and so pubsBox should continue to move 10 pixels to the left every second. I understand that i have to use a Timer, but what I'm concerned about is the fact that I can't get Flex to recognize that the mouse is still OVER "wrapper" and continue firing the event.

View 1 Replies

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

ActionScript 2.0 :: Last Empty Movie Clip Generated Doesn't Fire EnterFrame More Than Once

May 22, 2008

I have a flash file that reads and XML file, it creates an empty movie clip in a placeholder (mc_image_holder) for each entry in the file, so 4 entries in the XML file = 4 movie clips inside the placeholder. it does this like so:

Code:
if(success)
{
var nm:MovieClip = mc_image_holder.createEmptyMovieClip("swfHolder"+i,-((i) * 10));
nm.loadMovie(filename);

[code]....

however, for some reason, the last created movie clip in the place holder never fires the onEnterFrame event more than once, so, If I were to trace the word "hi" I would only get it once, where as if I apply that to each of the other three that are created, it would put it many times, as it should.

View 2 Replies

ActionScript 3.0 :: Not All Mouse Events Fire?

Sep 19, 2011

I am making a custom scrolling list (smart phone like) in actionscript 3 and have the parent contianer catch mouseEvents for MOUSE_UP and MOUSE_ DOWN.Sometimes the mouse up event is missed, maybe one in 20. Does this happen if the events fire to rapidly? I do not want to use the MOUSE_ CLICK event beacuse if the mouse pointer moved at all I want the list to scroll and not catch a Click event.[code]Can I somehow ensure that all events are fired?Or if not can I somehow get mouse button states directly from flash? Not via the mouse event object, but in onEnterFrame().

View 3 Replies

ActionScript 3.0 :: Alt Key Doesn't Fire It's Own Keypress Events

May 11, 2009

I've never needed it until today but I just found out that the alt key doesn't fire it's own keypress events. I need a way to detect when that key get's pressed - any ideas out there?

View 9 Replies

ActionScript 3.0 :: NetStatusEvent Doesnt Fire Some Of The Events?

Apr 3, 2007

if I say:
netStream.pause();
netStream.resume();

[code].....

View 2 Replies

ActionScript 3.0 :: NetStatusEvent Doesn't Fire Some Of The Events?

Jul 7, 2009

if I say:

netStream.pause();
netStream.resume();
netStream.togglePause();

[Code]....

not that I especially need those but how can I rely on netStreamEvents if I dont know which is or isnt going to be fired....

View 4 Replies

ActionScript 2.0 :: Tracing A Empty Space?

Sep 23, 2011

Iam trying to race a empty space in png file, i hav 2 movieclips 1st has a png file with a hole in between and w movieclip s loaded behind this png, i want to load the second pic excatly where the hole s present in 1st clip,s this possible ?

View 4 Replies

ActionScript 3.0 :: Array With Empty Space?

Feb 20, 2009

I've been programming a simple shopping cart. The system has several product categories, and in each one, appears a list of products. Each product listing has a numeric stepper, for the client to put desired product quantity.

Now I have two Arrays (lets call them "arrayCat6" and the other "arrayEncomenda6"). arrayCat6 tells me the quantities for each product, even if the quantity is zero. The other is supposed to put only those whose quantity is different from zero.

The question I have is that, if in the products you choose two products, that have another one with zero quantity between them, the arrayEncomenda6 will have and empty entry, between the two products, and I don't understand why. Both Arrays are refreshed each time the numericstepper (of any product) is pressed.

Please does anyone know if this is a bug, or am I forgeting something. The code follows:

function actualiza6(event:Event):void{
var parcial:Number=0;
var aux_preco:String;

[Code]....

View 3 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.0 :: Do Any Events Fire When The Flash Player Exits

Dec 5, 2011

I use a LocalConnection object to prevent being able to run our SWF multiple times on the same computer. The problem is that this connection can remain in place even when the SWF which called it closes. 
 
I have:
 
1) An External Interface call to dispose() all HTML pages call dispose() on pageunload which closes the connection.... But this is unreliable because if the browser crashes, you are locked out of the SWF

2) I tried some crazy try/catch.  If SWF A exists and SWF B tries to be initialised.... SWFB cannot connect so it sends a function to SWFA to dispose(). This should free the connection for SWFB to connect to?  But this does not work well either because sometimes a localconnection can be in use but calling "dipose()" throws an error, often because the LocalConnection swf which should be available is already gone.
  
What this all comes down to, is that I need a way to detect when the player closes, so i can close the localconnection.
  
stage.addEventListener(Event.EXIT, onExit);
function onExit(e:Event): void
{
if (localconnection)

[code]....

View 2 Replies

Actionscript 3 :: Flash Failing To Fire Any Events On URLLoader Sometimes?

Aug 10, 2010

I have an instance of URLLoader that works perfectly on my machine and a number of other machines, but in a few rare cases, regardless of the browser or the flash player version, URLLoader never comes back with any of my callbacks and so the load() method is fired off into the stratosphere and nothing happens beyond that.Curious if anyone else has encountered this and if so how they got around it.[EDIT]Ok... never mind on the "no callbacks are fired". In fact it is firing the SecurityError.SECURITY_ERROR. However, I'm at a total loss as to why it would only fire this on some machines and not on others. Does it have something to do with the user's admin privileges or the browser's security settings? The error is 2170, phaseTwo (whatever that means)

View 3 Replies

ActionScript 3.0 :: Keyboard Events Do Not Fire In Debug Movie

Jul 9, 2010

I have some keyboard events that work fine when I "test move" however when I debug the movie the keyboard events don't seem to fire.

View 3 Replies

Flash :: Empty Space After Tweening Movieclip?

Aug 19, 2011

I'm filling arrays from a XML. These arrays have dynamic textFields inside them, and these textFields are childs of a movieclip.

I tween this movieclip, therefore making the array of textFields animate on the stage one by one. There are two sources of XML, one from an actual site, and another from a XML stored in the hdd. First i fill the arrays of textFields, and then animate the movieclip. I do this for the first one, then animate it, do it again for the 2nd one, animate it, again for the 1st one, animate it, so on so on.

myTween = new Tween(mc,"x",None.easeNone,sizeOfStage,0 - mc.width,mcSpeedAuto,true);

my tween ends at 0 - mc.width, the problem is, if i tween first the
"bigger" XML, when the next one which is smaller gets tweened, there's loads of empty space before it tweens the big one again (tweening whitespace?).

myTween.addEventListener(TweenEvent.MOTION_FINISH, onFinish);

onFinish i clear all the arrays (otherwise the tweening of the 2nd one would still have information of the 1st one e.g: 1st has 25 fields, second has 10, 1st shows it's 25 fields, 2nd shows 10, and the 15 that were left from from the 1st one) and call the tween on the 2nd one. I thought that by doing this i'd be clearing all that white space too, apparently not. I think the mc.width just keeps the "bigger" value and always tweens with that, taking longer to end in the 2nd case. I've tried setting the mc.width as the sum of textfield width's everytime i fill the arrays, but this hasn't worked either

View 1 Replies

ActionScript 3.0 :: RollOver Detected In MC's Empty Space?

Jul 26, 2009

Is there a way to have a rollover's listener trigger it's method as long as the mouse is in bounds of the target movie clip? I have a rollover being listened for by a movie clip that contains multiple children and none that fill the entire space so the rollout event that is also registered to this same movie clip will trigger when I roll into the empty space.

I could probably add a new child that fills the movie clip and set it's alpha to something low like .01 but I was wondering if there was a different way to do this. So the question again is, how can I have a mouse rollover trigger as long as it is in the movie clip's bounds even if there are empty spaces without children in them?

View 3 Replies

Make Flash Dynamic Text Field <a> Links Fire Events On Mouseover?

Mar 1, 2010

I don't mind if any answers are AS2 or AS3 solutions, just curious really - seems weird that I couldn't find out how to do this really quickly.

View 2 Replies

ActionScript 2.0 :: Empty Movieclip Doesn't Respond To Events?

Dec 19, 2007

This code doesn't do anything when I rolled over...

this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
_root.logo_mc.onRollOver = function(){
trace("rollover!!!");
}
logo_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg");

View 4 Replies

Flex :: Air - Event Will Only Fire Once

Oct 12, 2009

In an AIR application, I have a private variable and a setter:

[Code]...

The first time that I set "saveResult" the event fires. But it will never fire again unless I restart the application. If I change the setter to:

[Code]...

View 2 Replies

Flex :: CurrentStateChange And CurrentStateChanging Do Not Fire?

Dec 15, 2009

I wanted to use the currentStateChange event in my application but whatever code being called in this event was not executed so I thought may be there's something wrong with my code so I tried testing it on one of the examples in adobe live docs.So I took this example here

<mx:states>
<mx:State name="One">
<mx:SetProperty target="{p1}" name="x" value="110"/>[code]....

And all what I did is placing an alert in both events currentStateChange and currentStateChanging of panel One and I didn't get the alerts when clicking on the panel.I also tried replacing the inline code with a call to a function that makes the alert also nothing happened.

View 1 Replies

Flex :: Get ChangeWatcher To Fire When XML Is Appended To?

Feb 25, 2010

So I had a requirement to add an undo function to my app and I discovered this nifty ChangeWatcher class, but it's not doing exactly what I want and I'm hoping someone knows how.ChangeWatcher seems to monitor assignments to the variable reference. So when I say:

myXML = <xml/>

it fires off it's function just fine and dandy, but when I say: myXML.appendChild(thisOtherXMLVar)

I get nothing, even though the variable changes the reference doesn't so ChangeWatcher doesn't fire off the function.how to get ChangeWatcher to pick up on all changes to a variable?

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

Flex :: Roll_out Event Fire In Code?

May 24, 2010

I have made this short example to demonstrate some problems I'm having.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas
id="buttonCanvas"

[Code]...

View 3 Replies

Flex :: Event.Complete Does Not Fire When Loading A URL?

Aug 11, 2010

I'm an experienced AS developer, but this is something very basic about flex that I can't figure out. In the class below, I'm not sure why the function imageLoaded would not be executed when the image loads a url. Is there a race condition happening here? The application is completely loaded by the time this object is created and setPicture is called. How can I get the Event.COMPLETE event to fire properly in this case?The line and Log.info functions are conveniences for me, and they definitely work. Here's my MXML definition:

<?xml version="1.0" encoding="utf-8"?>
<photo:PhotoClass xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:photo="com.xxx.widgets.photo.*">

[code]....

View 2 Replies

Flex :: Does Fire An Event After A Chart Is Rendered In UI

Sep 7, 2011

I am looking for an event which is fired (if any) after a chart is rendered (visible in UI) in Flash, we are using Flex SDK 3.0. We have to capture the screenshot after the chart is rendered, current implementation adds a huge delay in update_complete event callback, this is slowing down the whole job of generating images. I tried to use EXIT_FRAME event, but this doesn't seem to serve the purpose.

View 2 Replies

Flex :: HTML Control's Event Won't Fire?

Sep 14, 2011

I'm having trouble firing or capturing the results of an event firing.

Here's the current code...

<s:Panel id="instructionsPanel" left="0" right="0" top="0" bottom="0" title="Register">
<mx:HTML id="htmlViewer" left="10" right="10" top="0" bottom="10"

[Code].....

What's happening is that the user fills out a form in the HTML Viewer, then when they click the submit button I want to be notified of the page change.

If they land on URL A, then they'll be shown one message. If they land on URL B, they'll be shown another.

However, the event isn't firing.

I've also tried COMPLETE and HTML_DOM_INITIALIZE.

View 1 Replies

Flex :: Fire Event Off YesNo Alert Box

Oct 9, 2011

This is very basic and there are samples out there, but I am still struggling.

I need to fire an alert with a yes/no option.

I need to do this in actionscript.

Alert.show("Open new tab to search in Google Maps?","No places found", Alert.YES | Alert.NO, this, alertListener, null, Alert.NO);[code]...

View 1 Replies

Flex :: Embedded Button.swf Does Not Fire CLICK Event?

Aug 9, 2010

i'm trying to embed a swf to my as3 flex project like this:

[Embed(source = "../assets/next_button.swf")]
[Bindable]
protected var nextButtonClass:Class;
protected var next_btn:MovieClip = next_btn = new nextButtonClass() as MovieClip;
// ...
next_btn.addEventListener(MouseEvent.CLICK, onAdChange);

next_button.swf is as2 and created with adobe flash cs4. there is a single button inside it.

if i change type of button symbol to movieclip at next_button.fla, there is no problem at passing CLICK event.

i tried to cast next_btn to mx.controls.Button and fl.controls.Button classes, next_btn is becoming null in that case.

by the way button is reacting mouseover and click events properly just doesn't pass it to upper swf.

is there any trick i can do to pass Button events to my container swf?

View 3 Replies







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