ActionScript 3 :: Not Receiving OnSync Delete Events For SharedObjects In SWF
Feb 27, 2011
I have an application that uses Remote SharedObjects and I am seeing some strange behaviour. I am writing an ActionScript application in AS3 using Flash Builder and connecting to Wowza Media Server 2. My application is working just fine but I am now trying to write unit tests for it using FlexUnit. My unit tests involve creating multiple connections to the same remote SharedObject and making sure that I am getting updates correctly. Everything seems to be working well except that I am not getting any of the SyncEvent.SYNC events with an info.code of "delete".
When I run my applications independently in separate tabs or even separate swfs embedded in the same page it works fine. For some reason though it does not work when inside a unit test. I have also found that if I load the swfs using a Loader inside the same SWF then I get the same behaviour. It seems to me to be something strange about the way multiples of the same SharedObject behave within the same SWF. I have had to work around other strange behaviour in the unit tests such as oldValues not being set properly in the onSync events too.
View 1 Replies
Similar Posts:
Oct 8, 2010
I've added an event listener to my stage like this:
[Code]....
The problem is, some keys don't trigger the event. So if I type "ASDFG" I only get a response for "F" and "G", here's the trace:
PHP Code:
Engine.keyDown 68Engine.keyDown 71
My structure is like this.
Main class is Game.Game creates an Engine and adds the engine to the display with addChild()
EDIT: It seems it's because the keyboard events are being taken over by Flash CS3 and using them to select Tools and not letting them go to the SWF, very very annoying. - Can I turn this off?
View 2 Replies
Jan 14, 2011
I have a Sprite which is a child of a Flex object, and acts as the main "game window". So during game-play it should get keyboard input but at other times not. When I add a keyboard listener to it, it never fires.
Do I need to stop parent objects 'eating' the events somehow, or something similar? I get the same thing with mouse-wheel events, but mouse-click events are fine. Sprite doesn't seem to have the concept of focus unless I missed it.
More generally in this kind of approach, are there any suggestions on the best way? For instance some keys might still be needed to be intercepted before getting to the game-window, like ESC or F1 or something... the aim is the game-window isn't aware of other UI.
View 3 Replies
Mar 2, 2010
AS2, Flash CS4. We're using ExternalInterface to get callbacks from JavaScript for mouseover and mouseout when the user rolls on or off the .swf on a page. This works fine in all situations except for one:If the .swf is viewed in Mac Firefox, and if there is a button or mc near the edge of the stage with an onRelease() event, when you mouse from outside of the .swf into the button, the mouseover fires correctly; but when you mouse out from the button and continue outside of the .swf, mouseout never fires.We have built a small, simple testbed with only minimal code and assets (ExternalInterface code and a button). We are able to duplicate this consistently, on multiple machines. (again, Mac Firefox only).url....
View 1 Replies
May 18, 2011
Just wanted to ask is it possible for a flash app to capture mouse and keyboard events when it loses focus. I've tried putting it in a div container through SWFObject library and than used jquery forward mouse events plugin, but without success. My idea was to capture mouse events (click event) on the body and then transfer it to the flash app
View 2 Replies
Jun 23, 2010
I am attempting to dispatch an event on the click of any of the buttons in a button array in the document class of my application. The intent is to have an external object receive this dispatch so as to remove a listener for the EnterFrame event in this class.
Here is the Main.as code (document class):
Code:
package {
import flash.display.*;
import flash.events.*;
public class Main extends Sprite {
private var one:MovieClip;
[Code] .....
View 3 Replies
Feb 1, 2007
I'm having a problem with a custom subclassed Event class. Or I should say, I'm having trouble receiving events from this custom event class. I'm pretty sure I have everything wired correctly, the event is dispatched properly and my trace shows the Event instance being spawned. However, my eventListener, which is in another class, never fires its handler function.Have any of you run across instances where custom event classes fail to fire? I'm about at my wit's end.
View 14 Replies
Apr 20, 2011
i need to track the mouse movements(and register what component is under the mouse), it is done already, but i meet new problem, if click right button then context menu will be opened and no any new events(mouseMove, mouseOver) received by my components. I understand that this context menu is more browser then flash/flex and afaiu the is no way to disable context menu at all. So may be somebody know any trick to avoid this events blocking?
View 1 Replies
Mar 9, 2010
i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite.i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bottomSprite that are covered by topSprite.
var bottomSprite:Sprite = new Sprite();
bottomSprite.graphics.beginFill(0x666666, 0.5);
bottomSprite.graphics.drawRect(150,150, 150, 150);
bottomSprite.graphics.endFill();
[code]....
View 1 Replies
Sep 8, 2009
I have a dragable object with something like
on(press){ startDrag("object");}on(release){ stopDrag();
}
How do I make it so that when the mouse button is released it makes it so the object can't be picked up any more (basically it removes the on(press) part)?
View 7 Replies
Aug 7, 2009
I am searching for the syntax to call an OnSync event on the server-side. I tried this one but there is neither a compiling error nor anything that is traced.
application.onAppStart = function(){
trace("onAppstart");
userList_so = SharedObject.get("userList", false);
[Code].....
View 2 Replies
Nov 12, 2010
I got these four errors when I tried to create a button on the stage that would delete the text I inputted in the inputtext(ti). Based on the scripts I have and the errors, what should I write to create the delete button?
[Code]....
View 2 Replies
Mar 26, 2010
I am implementing a flex auto-suggest combobox - as the user types in each character: Consider the string 'Stackoverflow' and user input = 'st'
1) the data provider is filtered to show all items starting with 'st'
2) text is set to auto-suggest string such that the un-typed part is highlighted.
So for instance, the combobox text may contain st'ackoverflow', where 'ackoverflow' is highlighted using setSelectedIndex()When I hit back-space or delete, and check the 'this.text' value, I expect that the last un-highlighted character ('t' in the above case) gets deleted and the data provider is filtered to show all items starting with 's'. However the text property contains 'st', as before
View 2 Replies
Nov 18, 2009
Ive tried converting the SharedObject tutorial [url...] provided by Adobe from AS2 to AS3. When one client moves the ball, the other client should be able to see the ball moving on another swf, and vice versa.The AS2 one worked fine with my flash media server 3.5 and wampp server on. When I tried the AS3 one, the sharedObject cannot sync, even though the connection was successful and the sharedObject "position" was created in the server.[code]...
View 9 Replies
Aug 14, 2009
Is it possible to execute a "foreach" through each of my SharedObjects?
Something like this . . .
_so = SharedObject.getLocal("test","/");
foreach (var item:Object in _so)
{
// print key name and value
}
View 1 Replies
Jun 22, 2009
how to make a simple log in and registration form for my game let say the user downloads the game then he craeates an acc on his local PC and then uses it to play the game that is all i want so can anone make me a sample.fla to see how this type of log in form works?
View 1 Replies
May 25, 2005
[URL]. Click options, and in the resulting panel you will notice that there is a bunch of different options you can turn on/off/change. How can I use these variables with sharedObjects so that anything the user saves will get saved for the next time they come to visit my site?
View 3 Replies
Aug 1, 2008
I'm having trouble reading a sharedObject. I know it's written to the server because I can open it with wordpad and read it and the proper values are there. However, mySO.data.visitDate is always null or the size is 0.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initApp()">
<mx:Script><![CDATA[
[Bindable]
public var welcomeMessage:String;
[code]...
View 3 Replies
Sep 15, 2010
is there any way to delete all shared object data for a domain? We used generated names for our swfs and over time it has created enough to reach the 100kb limit for our domain, creating the user prompt. AFAIK, I cannot access the path above catOrgan_3342.swf to clear the other dirs catOrgan_3341.swf catOrgan_3340.swf etc, nor is there a global clear, or a way of enumerating the subdirectories.
Application DataMacromediaFlash Player#SharedObjectsQBX3423www.fluffycats.comcatOrgan_3342.swf<m y files>
View 2 Replies
Oct 20, 2010
I am serving two different swfs that read and write to the same SharedObject variable. The SharedObject variable is a number, and each swf checks that number to make sure it isn't using the same number twice. It then stores the last number it selects. In this way both swfs should never use the same number twice, no matter which order they're loaded.
If I repeatedly load one of the swfs, the never-twice rotation works. However, when switching back and forth between swfs, sometimes the number is repeated. SharedObjects are supposed to be global to the Flash Player, so why would this happen?
View 2 Replies
May 6, 2003
So I did the tutorial about SharedObjects, and I created a login movie which works fine.
My questions are as follows: Can i use a shared object I created in one movie (call it "mycookie") in a separate movie on another page, similar to an HTML cookie? If so, what is the syntax?
I tried reusing the mycookie = SharedObject.getLocal("user_profile")and it didn't seem to work. =(
Also, I know that alternatively I can pass flash variables to the URL with the POST method, but I forget the syntax. Time is of the essence here (project due tomorrow) so I'd really like some help if somebody knows the answer..
View 2 Replies
Jul 1, 2009
Everything dealing with sharedObjects in the first frame is this:
[AS]
var PlannerData:SharedObject = SharedObject.getLocal("PlannerData");
SubjectChoices = PlannerData.data.subjectChoices;
if (SubjectChoices == undefined) {[code]....
Going to the second frame from the first frame, the data is perfect. Going back to the first frame from the second, I'll trace the data many times throughout the code without an onEnterFrame, and it'll tell me that the Array is good...But when I trace the onEnterFrame, it shows the Array is [undefined, undefined, ...] like..undefined 17 times.
View 1 Replies
Oct 9, 2009
I am trying to make a little picture store for my website.I want to store the items in sharedObjects, so the next time people come to my site the selected pictures are there for them.I learned a little bit of sharedObjects and make it work for me with Strings but I can't make it work with and Array.
View 3 Replies
Jun 13, 2009
I have a an array of a custom class that I'm trying to store in a SharedObject.Storing is working fine, but when I recall the SO next compile it only returns an array of generic Objects instead of my custom class. This only happens with custom classes.Code excerpt below, this may be way too cut out, but it seems it's what I've narrowed the problem down too.[code]
View 2 Replies
Jun 2, 2011
I have a project that I think may be more manageable if I break it up into multiple small .swf files rather than having a gargantuan mega .swf.Now, I know that I could use a root .swf and load data from the others, but I think that it'll be a lot easier to debug and update if I'm using separate self-contained .swfs, so this is the direction I'm currently investigating.
However, the .swfs won't really work unless I can have user-data persist between them, so I'm wondering if I can load a SharedObject saved by another .swf file? Are there any important caveats that I need to be aware of?In particular, can anyone give me sample code that would allow me to do this with both an online and offline copy of the files; i.e - if I run the same set of .swfs from haravikk.com, and locally, I want them to still be able to share data with one-another. In this case though I won't need to worry about sharing data between a local copy and [url]..., just so long as the files themselves can pass data within whatever domain they're loaded it should be fine.
View 4 Replies
Jan 27, 2011
There are 3 flv movie in my flash page. Is there a way to indicate in my flash page if the flv movie is already viewed on user's browser? I need to put a mark on the movie if one of them is already viewed? Am I to use Shared Object?
View 1 Replies
Sep 11, 2011
So, I'm creating a quiz, and I'm using shared objects to save their resume data. So far so good. MOST of the various things I put into myso.data work fine. But oddly, two bits of information, specifically a String and an Array of Strings come out as [object][Object] when they are reloaded later. Now, at first I thought that maybe they just weren't getting written correctly, so I thought to trace them out before and after I put them in the SO.
When I do trace(myso.data.sectionName) or even trace(myso.data.sectionNamesArray) the first time (i.e. immediately after they get written, but before closing the window) everything works as expected. But if I trace those same things out upon the reopening of the swf, those things become [object][Object] for the String, and an array of [object][Object]s for the Array. So I thought maybe it was Strings in general, but other pieces of information, also Strings or Arrays of Strings trace out fine before and after. It's just these two pieces.
View 2 Replies
Nov 27, 2010
I have been working on a game (Pokemon haha) since around the beginning of June. I just started experimenting with Classes today and I've run into some big problems (as expected). I have many SharedObjects in my game and I started the game when I barely understood any code. But I've worked on it a lot and learned so much. Right now, I'm trying to create Classes so that I can save time and be more efficient with my code. But... With my first major attempt, I failed.
This is what I want to do:
Create a Class that will switch a bunch of SharedObjects in my game. I don't need the switching part (because that worked before when the code wasn't in a class), just the creating the class part that involves SharedObjects.
This is basically what I have:
ActionScript Code:
import flash.net.SharedObject;
class GrassLife {
so = SharedObject.getLocal("so_file");
function Life() {
so.data.variable7 = so.data.variable2;
so.data.variable2 = so.data.variable1;
so.data.variable1 = so.data.variable7;
//The variables switch at this part
}}
View 1 Replies
Oct 26, 2008
I've been working on something of late that will display text the first time the user views it, and the second time, say something different. I've accomplished this using haredObjects. However, it seems that the information (the shared object) isn't removed when the user leaves of closes the browser. I there a workaround for this?
View 2 Replies
Aug 26, 2011
I am working on a flex project using sharedobjects to store information on my server. I am not 100% sure how to do this, so I was looking up tutorials and came across this bit of code:
[Code]...
But when it gets to the 3rd line, it crashes. I don't know how to use the debugger for flex sadly enough
View 1 Replies