Actionscript 3.0 :: Add A Non-visual Object Like My SndManager To The Application Object?
Apr 10, 2010
Lets say I have a visual component (button) and a non-visual Object that receives a message and generates music in realtime (using an internal Sound object, etc). What's the best way to make the connection in OOP/AS3? In other languages, I've used to add the objects to a top level object (something like the Application object) and let them see each other. Example: Add button to App, add SndManager to App. Click on button, notify App, make App invoque the play() method on the SndManager.I'm asking you this because the above example looks odd to me. In fact, I'm not sure if I can add a non-visual object like my SndManager to the Application object.how can I bridge this?
I'm using a loader for people to use to upload their own images for a background, and I want it to remember the image the next time they come to the page, so is there any way to save the loader data in a shared object? I haven't tried just using something like
I can't seem to figure out how to accomplish a fairly simple task: I have a simple graphic and I'd like to apply an "orbiting" effect to it - so that the graphic moves in a circle around an arbitrary point (without rotating around its own center).[code]...
I want adobe sockets to send "customized" class object to a server socket(WinSock2). I used socket.writeObject(myClassObj). Actually My flash application and windows application works for string buffer but not for object.
Code: //Flash var buffer:String = "God Bless Us"; socket.writeUTFBytes(buffer);
So I have this Photo class than handles loading a pic, and dispatches an event when the loading is done with:[code]which is simple and works, but now I'd like to make something more advanced. I'd like to dispatch the load ratio.So far I have extended the Event class, with my own EventRatio class, and I can put properties on that class. Which is cool, but I need something more dynamic than just sending a fixed value.So, what is the best way to connect the Loader object of the Photo object, with the EventRatio object?
[url]...I added clear button, which clears all lines from user's whiteboard, but every other user who is connected to whiteboard, still sees lines. But when other users refresh the page, lines are gone too. That means I'm able to delete data from shared object, but I don't know how to update other users' whiteboard.[code]...
so I have a lot of classes in actionscript 2. But I need to modify my application to use the soundchannel object for audio monitoring. as far as i know this is only in actionscript 3. so it it possible to write one class in AS3 and leave the rest in AS2?
if not is there a conversion tool which can make the process easier?
I have this situation where i'm trying to save "chat logs" while people switch around views in my flex mobile application..so, my plan is i'm starting out with a main object that I plan to re-use as the main chat log object..I call it textObjso, when someone new wants to chat my plan is to make a new object with the persons username.so how if i were to get the username from something like data.username how could I translate that into the var name of the object I want to make? So in the end i end up with.[code]
I need to put a Flash Object in my website developed on MVC2 .NET, however the third party who made it just gave me an html with this code.HTML errors apart I don't know how to put it on ASP.NET.
I'm trying to use google maps in my wpf c# project, I've installed Adobe Flash player but cannot for the life of me find the shockwave player object reference or when I add a new item in the toolbox find in, both in the COM lists. I had to download and install flash using internet explorer.
I am trying to store my Application.application.parameters to my local variables For example: var myVar:Object = Application.application.parameters; So here is the tricky part, is I do ObjectUtil.toString(myVar) I can see all the values and properties. However if I do myVar.clientName or any other properties I always get null or undefined.
I have a couple of static functions (one shown below) that can be called from multiple instances; there is a problem because of a shared object I am using.
My tracing shows that the application is in this function or the converse function addRec when my application is crashing.
[Code]....
In another class I have this statement where I set the value of some date in my shared object. I have to comment the following lone of code out in order for the application not to crash after a short while:
so.data.rArray = currentRecs; // the culprit I see the first trace in the removeRec function but then nothing. I expect to see the second trace indicating that the array of current recordings taking place (currentRecs) has been cut back by one.
Originally my function was not static and my application crashed very quickly. By making the function static the situation improved insofar as it took longer for the application to crash. Flash seems to be very particular about the way it handles shared objects.
If I'm streaming live video and chatting in an FMS app, should each component have its own instance of NetConnection or should they share one? Was thinking perhaps the quality of the live video stream would be hurt in a sharing situation but am not sure the architecture works like that.
From a development standpoint, I'd like to make one NetConnection instance in my main application file and connect with it. Then, when successfully connected, I'd like to pass that connection into any custom components that need it.
I have a flex 3 project with a root mx:Application. The width and the height are set to pct values, because the application has several sizes that can be chosen by the user, so the correct size is set on the embed's width attribute.
how to access the value in that attribute. I read in several places that this.root.loaderInfo.width should give me that value, but it always returns 500, which I am guessing comes from the default application container width [URL].
I realize I could pass it as a flashvar, but that is not a good solution in this case due to the nature of the project. I've also tried pplication.application.width, stage.width, and stage.stageWidth, to name a few. I can't depend on any of those values, since they change based on the browser zoom level.
I have a couple of static functions (one shown below) that can be called from multiple instances; there is a problem because of a shared object I am using.My tracing shows that the application is in this function or the converse function addRec when my application is crashing.
public static var currentRecs:Array; private static function removeRec(recName:String) { trace("Removing record "+ recName + " from currentRecs"); for (var item in currentRecs) { if (currentRecs[item] == recName) { currentRecs.splice(item, 1); trace("Finished recording " + recName + " currentRecs = " + currentRecs.length); } } }
In another class I have this statement where I set the value of some date in my shared object. I have to comment the following lone of code out in order for the application not to crash after a short while:
so.data.rArray = currentRecs;// the culprit I see the first trace in the removeRec function but then nothing. I expect to see the second trace indicating that the array of current recordings taking place (currentRecs) has been cut back by one.
Originally my function was not static and my application crashed very quickly. By making the function static the situation improved insofar as it took longer for the application to crash.Flash seems to be very particular about the way it handles shared objects.
I'm trying to make text chat application using shared object. I'm using api Shared.getRemote("so",m_nc,true); to make the data persistent. It makes the file with extension fso. I want to save the chat history in notepad for further reference, and also load that data as per requirement.
I'm using code for the open source MP3 player Howler and trying to port it to a Spark MobileApplication type. I'm getting a null pointer exception and I have no idea what's causing it. I've tried debugging extensively with breakpoints at what I think is causing the error, and set breakpoints in the untouched Howler project but all the variables in scope seem to be identical between my non-working project, and the Howler project. The only thing I can think of is that Howler uses MX components and I am using spark. I've pasted all my code below (which is very long) but I've bolded the lines that are throwing the error. The error occurs immediately after I choose a folder in the browse folder dialog.
I have a NavigatorContent which is displayed when the user selects an item in a DataGrid. This NavigatorContent contains a form and an accordion displaying the related objects.
When the user presses the Save button in the NavigatorContent the form and the children should be saved to the database by calling the server through BlazeDS:
saveObjectToDB() { //Map the form values to the object object.field1 = object_field1.text;
[Code]....
The object that i pass to the accordion children is public and [Bindable] in the NavigatorContent and in the accordion children and is initially passed from the main DataGrid. May this be a problem relating to this issue?
Basically trying to update a "userlist" shared object everytime someone connects.Administration console live log reads:"Sending error message: ...main.asc: line 12: TypeError: this.usersSO has no properties"
I'm connected ok. Here's the server code Doesn't like "usersSO.setProperty()" call: application.onAppStart = function(){ this.uniqueID=1; this.users = new Object(); this.usersSo = SharedObject.get("userlist", false); }
My application currently contains a number of Widgets that are managed by a Widget Manager. When the user clicks on a widget (e.g. a Helper widget), the Widget Manager loads the widget into a separate sibling application domain with the following line of code:
However, I am unable to use the widget's variables and functions later on. I attempt to find the Helper widget from the Widget Manager's list of widgets, and I do successfully. But when I try to caste the Helper Widget from type IBaseWidget (the interface all widgets share) to type HelperWidget, I receive the following error:
TypeError: Error #1034: Type Coercion failed.....
This is because the application domain of the class trying to use the Helper widget is different from the application domain of the Helper Widget. I tried to fix this by loading all widgets into the same application domain as the loader:
When I use MouseEvent.MOUSE_OUT the target is [object MovieClip], but when I use MouseEvent.ROLL_OUT I get [object Bildspel] - and Bildspel is my class. The thing is that when I use ROLL_OUT I'm not able to delete the targets ENTER_FRAME event.
I have an object which is assigned a number of properties:
var project_array:Array = []; var slideObject:Object = { project_title : myXML.projects.project[i].title.toUpperCase(),
[Code].....
but I'm not quite sure where to place this. If I place it outside of the object constructor, I get "term is undefined", I guess because it doesn't know what project_clips_array is - but if I declare project_clips_array in the constructor, it appears to need to be defined, i.e. I can't create a blank property. But I can't place it in the constructor either, because it doesn't seem to allow me to run a function within an object constructor. What is the proper syntax or arrangement of code for executing this function to get the array within the object?
Alright, I've looked online at a bunch of different collision tutorials but they don't explain what I'm looking for. I want object A to hit object B and then execute a function via to a Event listener.