Flash :: Prevent Touch Event From Firing From Under Another Sprite

Dec 6, 2011

I'm trying to make a vieport in which you can pan by dragging the background image around. Here is what I've done: [URL] Note that I've hidden the mouse cursor and replaced it with 2 custom ones. The problem is, the event attached to the background, which is a touch event, fires even when the mouse is over a sprite/movieclip (the monkey or the stats) that's in front of that background. And the stats isn't even in the gameLayer (where the monkey and the bg and the mouse cursors are). Try to drag the stats around, and see that the background and everything else pans with it (this is unwanted). Also, I need to remove the custom cursor and show the regular cursor whenever the mouse is NOT on the background (i.e. when it's on the monkey or stats or any new sprites I may/will have in the future).

[Code]...

View 1 Replies


Similar Posts:


Flash :: Why Are Event Listeners Firing More Than Once

Jun 14, 2010

In my Flash project I have a movieclip that has 2 keyframes. Both frames contain 1 movieclip each.

frame 1 - Landing
frame 2 - Game

The flow of the application is simple:

User arrives on landing page (frame 1) User clicks "start game" button User is brought to the game page (frame 2) When the game is over, the user can press a "play again" button which brings them back to step 1

Both Landing and Game movieclips are linked to separate classes that define event listeners. The problem is that when I end up back at step 1 after playing the game, the Game event listeners fire twice for their respective event. And if I go through the process a third time, the event listeners fire three times for every event. This keeps happening, so if I loop through the application flow 7 times, the event listeners fire seven times. I don't understand why this is happening because on frame 1, the Game movieclip (and I would assume its related class instance) does not exist - but I'm clearly missing something here.

I've run into this problem in other projects too, and tried fixing it by first checking if the event listeners existed and only defining them if they didn't, but I ended up with unexpected results that didn't really solve the problem.

View 2 Replies

Javascript :: Mouseup Event Over Flash Object Not Firing?

Apr 8, 2011

I have got this script working from How to get mouseup to fire once mousemove complete working within the jQuery (document) scope.Later on I added a flash object inside the body.and when I click on the flash object the mousedown event fired, mousemove event fired, but not the mouseup event which where I want to unbind the mousemove. But when I click on non Flash area, mousedown works, mousemove works, and mouseup also works. It works like I wanted it to in Chrome, but not in Firefox.Here are the codes, and I called handleMouseDown in $(document).ready

handleMouseDown: function () {
jQuery(document).mouseup(function() {
Log("unbind.");

[code]........

View 3 Replies

Flash :: Custom Event Not Firing On Document Class?

Apr 28, 2011

Im trying to get my head round what is needed to catch event "Beep2", using dispatchEvent. The function "DoNext" is not firing, even though Im able to produce a trace result of the dispatchEvent "Beep2 true".

This code uses a CustomEvent Class to Extend the Event Class. Its right on my limit of knowledge so far,

[Code]...

View 1 Replies

Actionscript 3 :: Flash - Loader Event Not Firing In Firefox?

Mar 15, 2012

I just inherited some code that produces an embedded rdio music player into a swf. It works great in firefox and safari, except the embedded player does not appear in Firefox... :(

Is this a common issue with the Loader class or contentLoaderInfo events?

import flash.display.Loader;
import flash.display.Sprite;
import flash.display.StageAlign;

[Code].....

View 2 Replies

ActionScript 3.0 :: Flash - Event.COMPLETE Never Stop Firing?

Aug 1, 2010

I write directly on the time line on the scene and, well... the code looks fine to me, but my list of slideshows (which is what the xml contains) keeps on repeating itselfe... here is the code:

var uloader:URLLoader = new URLLoader();
//var slide:Slideshow = new Slideshow();
uloader.addEventListener(Event.COMPLETE, loaderCompleteHandler);

[code]....

View 1 Replies

ActionScript 3.0 :: Event.deactivate Is Not Firing With Flash Plugin 10,2,152,26 Embeded In IE 8 And Above

Feb 23, 2011

I am working on a portal which is built in flex. I wanted to perform some action based on my applications is in focus or out of focus. So  I tried to use two Events for this purpose Event.Activate and Event.Deactivate inside my flex code.
 
These events fire perfectly in FF 3.0 and above, Safari, Chrome and these events get triggered till IE 7.
 
But when I switch to IE 8 and above versions with latest flash player plugin 10,2,152,26 the Event.deactivate is not firing, and I am not able to detect whether my Flex application is out of focus.

I tried doing some research around this issue both using Flex Events and Javascript approach using window.onfocusin and window.onfocusout, but still no luck in IE 8 and higher versions with latest Flash plugin 10,2,152,26.

As we have a large number of users viewing this portal in IE 8 with latest flash plugin.
 
The code is simple and I have pasted below:
 
package {
import flash.display.*;
import flash.utils.*;

[Code]....

View 3 Replies

Actionscript 3 :: CHANGE Event Not Firing From Numeric Stepper (Flash)

Nov 8, 2011

I have a Numeric Stepper. If I click on the plus or minus my event will fire.

[Code]...

However, when my function changes the value based on a button press, the Numeric Stepper will update the number but it will not fire the CHANGE event.

[Code]...

View 1 Replies

Javascript :: JQuery Flash Object Click Event Not Firing In IE Or Chrome?

Jun 29, 2011

I'm just trying to understand a difference between IE, Chrome and Firefox. I have the following code on a page:

$('object').live('click', function(){
alert('Fired');
});

I then populate the page with some Flash controls (in my case, I'm using Uploadify). When I click on the Flash control, I see the alert in Firefox 4. However, I do not see the alert in IE8 or Chrome (I havent tested any other browsers).

View 1 Replies

Actionscript 3 :: Flash Filereference Select Event Not Firing After Using Browse() And After Selecting A File

Aug 11, 2011

This is the first time i am working in action script. I have seen a flash programmer working with it. since i know javascript i was able to work in action script. I am creating a file upload component for my php projects. Until now i have advanced to show the file dialog box using the FileReference api. The select event is not firing for me. and i did not get any error.

[Code]...

View 2 Replies

Flash :: Prevent A Parent Movieclip Event From Being Fired?

Mar 19, 2011

I have an AS3 movieclip with a button. Both the movieclip and button needs a click event but when I click the button it also fires the parent movieclip's event handler.

View 1 Replies

Touch Screen Can't Trigger Mouse Down Event Correctly

Mar 12, 2010

I am using it on a Sony vaio l pc (like hp's touchsmarts) in windows 7 the app doesn't need any multi-touch gestures (only single touch clicks and drags) so i am using mouse events

everything is fine (including mouse click and move events) except that a single touch to the screen (with no move) doesn't fire a mouse down. it is fired only after a small move of the finger

outside the app, on my desktop, i see that the small windows 7 cursor jumps immediately to where a finger is placed, meaning this issue isn't a hardware or a windows problem but rather how internally the flash app receives "translated" touch-to-mouse events from the os.

for example, in a windows Solitaire game, a simple touch to the screen immediately highlights the touched card.in my app, a button will change to the down state only if i touch it and also move my finger slightly (click events - down and up - are triggered fine)

shouldn't the MOUSE_DOWN event trigger exactly like how a TOUCH_BEGIN would in the new touchevent class?

View 6 Replies

ActionScript 3.0 :: Creating Custom Touch Event Handler Class

Jun 5, 2011

I have a problem that seems easy enough to solve but I'm trying to do it with reusable code, which involves doing something I don't understand yet. I've googled this endlessly and read dozens of articles and I'm still just as lost as when I started. I'm hoping a live human being can help me make sense of it.

I have a movie clip on stage. When this movie clip is pressed, I want it to play a certain frame of another movie clip for as long as it's being touched. (It's a map of the US, that will display each state name as it is pressed.) I COULD write 50 different functions, each to call a different frame of the displayName movie, or I could write my own custom event that would be able to receive from each touch event a string variable to then tell displayName which frame to play. So basically, I have, for example:

[Code]...

View 8 Replies

ActionScript 3.0 :: Touch Event Function Not Working For Mobile Project

Aug 23, 2011

I am using flash builder4.5 and creating simple touch event function in pure Action script mobile project. When I run with on desktop running it not works but mouse event works. How can I get this to work with touch event function on desktop running

Here's my Code
package {
import flash.display.Sprite;
import flash.events.TouchEvent;
import flash.text.AntiAliasType;
import flash.text.TextField;
[Code] .....

View 3 Replies

Professional :: Touch Screen Doesn't Trigger Mouse Down Event Correctly?

Mar 12, 2010

i have designed a gaming kiosk app in as3i am using it on a Sony vaio l pc (like hp's touchsmarts) in windows 7the app doesn't need any multi-touch gestures (only single touch clicks and drags) so i am using mouse eventseverything is fine (including mouse click and move events) except that a single touch to the screen (with no move) doesn't fire a mouse down. it is fired only after a small move of the fingeroutside the app, on my desktop, i see that the small windows 7 cursor jumps immediately to where a finger is placed, meaning this issue isn't a hardware or a windows problem but rather how internally the flash app receives "translated" touch-to-mouse events from the os.for example, in a windows Solitaire game, a simple touch to the screen immediately highlights the touched card.in my app, a button will change to the down state only if i touch it and also move my finger slightly.

View 8 Replies

ActionScript 3.0 :: Can Pass Touch Event To Class Defined 'global' Function

May 12, 2011

I have a class file defined in my package as MyGlobals.as.[code] (I have tried adding/removing "static" and "dynamic" to no effect.)I am trying to call a touch event from the main timeline in this way:myObject.addEventListener(TouchEvent.TOUCH_BEGIN, MyGlobals.myFunctionName);(I have tried removing the class name to no effect.)When I compile I get the error 1046: Type was not found or was not a compile-time constant: TouchEvent. This error occurs on function definitions in the class file.What syntax/concept am I getting wrong? The functions were working fine when I was using constants in the timeline, but I need to be able to reuse these functions over and over again, so I wanted them to be able to take touch event variables so that I didn't have to write a different function for every touch event.I tried googling "error 1046" but I can't find anything useful.

View 3 Replies

ActionScript 3.0 :: Event.ID3 Firing Twice Instead Of Once?

Jan 19, 2010

I have some code where an event handler listening to Event.ID3 fires twice for an MP3 file. From searching the web, I found a few others asking a similar question, but I haven't seen any response.

Does anybody know what would cause the ID3 Event to fire twice for a single file? My only guess is that the MP3 file contains two versions of ID3 format.

The code looks like this:

Code:

var mySound:Sound;
function setup()
{

[Code]...

View 2 Replies

Actionscript 3 :: Adobe AIR: Touch Screen Doesn't Trigger Mouse Down Event Correctly?

Mar 13, 2010

i have designed a gaming kiosk app in as3.i am using it on a Sony vaio l pc (like hp's touchsmarts) in windows 7. the app doesn't need any multi-touch gestures (only single touch clicks and drags) so i am using mouse events. everything is fine (including mouse click and move events) except that a single touch to the screen (with no move) doesn't fire a mouse down. it is fired only after a small move of the finger

outside the app, on my desktop, i see that the small windows 7 cursor jumps immediately to where a finger is placed, meaning this issue isn't a hardware or a windows problem but rather how internally the flash app receives "translated" touch-to-mouse events from the os.for example, in a windows Solitaire game, a simple touch to the screen immediately highlights the touched card.in my app, a button will change to the down state only if i touch it and also move my finger slightly (click events - down and up - are triggered fine).shouldn't the MOUSE_DOWN event trigger exactly like how a TOUCH_BEGIN would in the new touchevent class?

View 3 Replies

ActionScript 3.0 :: Timer Event Not Firing?

Jul 13, 2010

I have a little flash app that I have running constantly on my server (I made it an exe). It runs great for a few days, but then eventually it just stops.

Code:
trace("test1");
var myTimer:Timer = new Timer(5000, 1);
myTimer.addEventListener(TimerEvent.TIMER, getData,false,0,true);

[Code].....

The code above should call the function getData once after 5 seconds have passed. This works 99.99% of the time, but for some reason (usually after a few days of it running) it doesn't call the getData function.

I have verified this through trace statements. When it eventually fails, it traces out test1, test2..... then nothing else. No test3.

I'm assuming I need to add an event listener for the timer object to check if it fails for whatever reason. How do I do this?

View 4 Replies

ActionScript 3.0 :: Event.COMPLETE Isn't Firing

Sep 21, 2009

Can anyone see why my event.Complete isn't firing

[Code]...

View 4 Replies

ActionScript 3.0 :: Event.COMPLETE Not Firing On PNG?

Dec 5, 2009

I'm sure some users on this forum will be aware that AddThis are dropping the Clearspring Launchpad, so I'm writing a new API to get ready for the changeover. Part of that is a base UI that will create buttons for social network sharing destinations. At the moment, AddThis contain all the icons in a single long strip that is 16x3520 pixels in size [URL]...
 
What I'm trying to do is load this into a utility class, but the Event.COMPLETE event never fires, and if the Loader class that loads it is added to the stage, the bitmap is never shown. I thought it was maybe a dimensions issue, but what is curious is that if I place the PNG on a Flash stage and export as a SWF, it loads no problem. If I dump it out as a JPEG, no problem. Its ONLY when the file is a PNG that there are problems trying to load it. I even tried dropping it out as a 24-bit PNG (the original is 8) but that had no effect.

View 2 Replies

ActionScript 3.0 :: Complete Event Not Firing?

Oct 13, 2009

I'm dynamically creating instances of a loader in a loop, adding a complete listener to it, and loading it. For some reason the complete function is not called. Is this syntax wrong?

[Code]...

View 2 Replies

Flash :: Transparent Sprite With Event Mouseover

Dec 27, 2011

I have a actionscript "Sprite" class which load a transparent png. When i set a "mouseover" event over the Script, it is throw when the mouse goes over the "square" containing the transparent png. I would like a glow effect to be displayed on mouseover, but only when the mouse is on the displayable part of my transparent .png. How can i do to throw the event only when the mouse is not over the transparent part of the png? Do i have to check by myself in the mouseover handler then do what i have to do?

View 2 Replies

ActionScript 3.0 :: Firing Event With ComboBox Component

May 21, 2011

I have a simple ComboBox onstage, with 5 options in it. Each one has a textual label, and is assigned a numeral "data" in the Component Inspector (1,2,3,4,5). I'm trying to get the playhead to move to a specific frame, according to which option is selected, and can't make it work. The trace turns out fine, but the playhead stays in place. (The ComboBox is called my_cb).

PHP Code:
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
trace("Value changed to: "+evt_obj.target.selectedItem.label);};
my_cb.addEventListener("change", cbListener.change);
cbListener.change = function(evt_obj:Object) {
var itemName:Number = new Number();
itemName = evt_obj.target.selectedItem.data;
if(itemName == 1) { gotoAndStop(10);}

View 2 Replies

ActionScript 3.0 :: Tween Start Event Not Firing?

Apr 21, 2010

I have this code below which produces no errors

import Card;
import fl.transitions.Tween;import fl.transitions.easing.*;import fl.transitions.TweenEvent;
 var ace_clubs1:Ace_clubs = new Ace_clubs();ace_clubs1.scaleX=0.4;ace_clubs1.scaleY=0.4;[code]......
 
The only thing is the TRACE output for the MOTION_START EVENT does not fire.

View 8 Replies

ActionScript 3.0 :: Firing Off An Event At End Of Alpha Tween?

May 5, 2010

If I have a movie clip that resides and plays in one frame, and I want an second (visible=false) movie clip to play on the same single frame as soon as the first is finished...  what kind of event to I use? Do I have a frame action inside and at the end of the first movie clip that throws out some kind of event to tell the second to play?Basically, I have a menu (first movie clip) that alpha tweens up, then the buttons (second movie clip) to appear when the first is 100% alpha.

View 8 Replies

ActionScript 3.0 :: SoundComplete Event Cant Firing NextFrame?

Oct 2, 2011

soundchannel.addEventListener(Event.SOUND_COMPLETE  , onSoundComplete);
function onSoundComplete(e:Event):void{
nextFrame();

[code].....

View 3 Replies

Flex :: Event Listeners Not Firing In Code

May 15, 2011

event listeners not firing in this code can anybody guide me what is problem with this code.[code]

View 2 Replies

Flex :: Event Listener Callback Not Firing?

Jun 17, 2011

In our app, I am periodically noticing that a particular event handler is not firing. 99% of the time, it works fine, but, every so often, it just dies. How can I find out whats happening? Is the DispatchEvent() not happening/working somehow? Is my listener still listening? Did something else catch the event, and not pass it along so that the 'right' listener can get to it ?

Here's a little bit of the code...

Thats a somewhat pruned down version of what the real code is, but I don't think I trimmed out anything important. The key, as I see it is that we fire up the params dialog, then start to listen for the closed event. Then, we show the param dialogs close function. What happens when it fails is that the trace message "caught close event.." is never generated, and, consequently, the closeHandler is not getting called at all.

View 1 Replies

Actionscript :: Flex 4 COLLECTION_CHANGE Event Not Firing?

Aug 25, 2011

I'm currently trying to achieve 2 way binding of an ArrayCollection object. However, the COLLECTION_CHANGE event is not firing.

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

[code]....

I'm trying to achieve 2-way binding with the Booths variable.the COLLECTION_CHANGE event never fires even when I add 2 new items in the Booths variable in the App.mxml

View 3 Replies







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