Flash :: Displaying Flex Object References
Jun 10, 2010
I have a bit of a memory leak issue in my Flex application, and the short version of my question is: is there any way (in AcitonScript 3) to find all live references to a given object? What I have is a number of views with presentation models behind each of them (using Swiz). The views of interest are children of a TabNavigator, so when I close the tab, the view is removed from the stage. When the view is removed from the stage, Swiz sets the model reference in the view to null, as it should. I also removeAllChildren() from the view.
However when profiling the application, when I do this and run a GC, neither the view nor the presentation model are freed (though both set their references to each other to null). One model object used by the view (not a presenter, though) IS freed, so it's not completely broken. I've only just started profiling today (firmly believing in not optimising too early), so I imagine there's some kind of reference floating around somewhere, but I can't see where, and what would be super helpful would be the ability to debug and see a list of objects that reference the target object. Is this at all possible, and if not natively, is there some light-weight way to code this into future apps for debugging purposes?
View 2 Replies
Similar Posts:
Jun 20, 2011
I was thinking about Flash GC the other day and came up with a question about how reference counting would work in the following 4 class scenario (assume GuiMain is the movie's document class):
[Code]...
View 4 Replies
Dec 14, 2010
I'm looking to create a flashBuilder document which uses seperate MXML files as "views" which are controlled by states - I believe it's a design pattern of sorts but I'm relatively new to FlashBuilder. I was wondering if anyone knew what design pattern it was and if I can be pointed in the direction of some good references! FYI I'm looking into using FlashBuilder to design Android apps
View 1 Replies
Nov 4, 2010
I'm writing an application where I have many objects (data models) that are identified by a unique String ID that every such object possesses and these objects can refer to each other by their IDs.So far so good but now I need to keep track of which object keeps a reference to another object and of course there are cases where an object references (or is referenced by) more than one other object and I was wondering what would be the best method to store these references? In a simple map data structure I could just map one object's ID to another but as mentioned there are cases where an object can hold a ref to an arbitrary amount of other objects
View 1 Replies
Jul 22, 2010
I need to disable all the aspects of functionality which access the client file system in a flash/flex application. I started having a look on how to do this. It appears that the package flash.filesystem need to be importated to allow the interaction with the file system. However, I did not find any reference to this package in the application. I am a beginner concerning these technologies so maybe I am missing a point here. Do I need to look into an other direction?
View 1 Replies
Mar 8, 2012
Does anyone know if it's possible to list the references an object currently has in ActionScript3 (e.g. listeners, children etc)?
I'm trying to clear an object from memory ready for garbage collection but for some reason it's hanging around.
View 2 Replies
Sep 22, 2009
I am trying to create an object that is handling the events of different objects. The object is created in the 1st frame of a code layer:
ActionScript Code:
var gImageEdit:ImageEdit = new ImageEdit( imgAction, movImageFront,
movToolbar.btnZoomInImage, movToolbar.btnZoomOutImage, gZoomSound );
[code].......
View 1 Replies
Jun 3, 2010
I'm just getting to grips now with how the Garbage Collector works.
Is there a way (like a function or a custom class available somewhere) to check an object for all its references and return them so that you can see what it's connected to?
View 2 Replies
Aug 12, 2009
* Is it possible to create weak references to objects (like theventListener/EventDispatcher is able to do) so that if they are removed, you won't be stuck keeping a reference and taking up space to something that should be garbage collected?* Is there any way to find out how many active variables are referencing a certain object? This would be handy to actually create weak references, since, if you for example, have a static array containing all objects created in that class, you can do a regular check to see if there is only one remaining reference, and if so, you can safely remove it.
* Also, might there be any way to list the entire space (one big chunk of binary data, most likely) of every variable currently running in the program, all references, basically, what Flash is currently storing in RAM?I'm pretty sure that Flash (as crappy and lacking as it is in so many areas) does not have anything like any of these built in, but hopefully there is at least something.
View 3 Replies
Oct 29, 2010
I want to do is create several arrays to hold groups of movie clips (i am using as buttons) which have similar functions so that I can add event listeners using a for loop statement rather than making a huge list of add and remove event listeners.I have seen this method working before but I cannot get my code to work!! This is probably a very noob concept but I have been struggling with it for hours.Ok, so in the extends movie clip bit on my as file I declare the array as such:public static var controlBtns:Array;Then in the initializing function I put values into the array as such: [code]The trace seems to output all the object names (as they are listed in the library) and then I get this error: TypeError: Error #1010: A term is undefined and has no properties.Which is kind of obvious as I cannot seem to access the movie clip instance names that I have set up in the array.I tried putting quotation marks around the names in the array making them strings but then I can't access properties of strings - which is obvious enough to.
View 8 Replies
Aug 18, 2009
I have a 2-dimensional array of Objects. Their location in the array determines where they appear on the screen. When I want to move an object down, I am trying something like this:
[AS]LocationArray[i][j+1] = LocationArray[i][j];
LocationArray[i][j] = null;[/AS]Of course, with the way AS3 handles objects and references, it removes the object completely. How can I simply move a reference (or remove an reference) without destroying the object?
View 1 Replies
Sep 29, 2004
loading external SWF's and its class files hanging around after the movie is unloaded....Its kind of tricky to explain, but you can see it very clearly in this file... http:[url]...Just run the main_stage.fla within flash [mx 04] and you'll see that if you click "Tester A" it will trace out "My Name is Tester A", then if you click on "Tester B" it will load a different swf, with a different class, but still trace out "My Name is Tester A" when it should be "My Name is Tester B"....
I have tried, unloading the swf's, removing the mc_Dropper and re-attaching it, re-declaring the variable testObj as null before declaring the class,
View 2 Replies
Nov 6, 2008
I am a new flash developer and I cannot seem to understand this problem. Whenever I try and trace one of these variables of type XMLList they all return NULL except for the last one in the array.The createDatsSets() function is designed to pull XMl data and copy it to an variable of type XMLList which resides in an array. This should happen 8 times to add data to all 8 variables.It works fine with a single variable but, in the for statement when.I try and trace any of the variables in the xmlList array only the last one has XML data in it.
View 4 Replies
Oct 12, 2009
I'm trying to get my head around optimising AS3 code and clearing things out for garbage collection.
I understand that each time an item is referred to in the code it has its reference count increased by one, so I was wondering if there is a trace option I can use to see how many references each of my objects has?
I can then see where things are getting left behind (if they are) and where I can make optimise better.
I think it would help me work out several issues if I was able to do this
View 1 Replies
Jun 23, 2011
On Senocular's page http://www.senocular.com/flash/tutor...ashcs3/?page=2
there is a Tip: Reducing Display Object References I need help with.
if I do:
[Code]...
without removing the listener, does that still leave a reference to "myMovie" in memory?
View 8 Replies
Feb 9, 2012
When i first load the page the flash container div is set to display:none, i then apply some jQuery to .fadeIn() and set the div heigth and width size. Fine. But within this div i embed the flash object this way:
<object width="692" height="389">
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
[Code]....
Basically the issue is that I need to use the old flash object only for firefox as otherwise by using the iframe method form vimeo I'd get random black screen for the video, the solution is to use the flash object, only for firefox but for some reasons I don't get the video displayed while i can see the object in the DOM.
View 1 Replies
Jan 25, 2011
I'm writing a MVC web app in ASP.NET MVC, which is supposed to be serving up a Flash object written by one of my colleagues. I don't know any Flash; he doesn't know any C#/ASP.NET; hence the question goes to SO!
[Code]...
View 3 Replies
Mar 28, 2012
I have a flash object embedded in my website with the embed code that I got from a website. It does not show up in Safari, it's just a blank area where the flash object is supposed to be. What can I do to get the object to show up in Safari?
Here is the embedded code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" height="250" width="258" id="sn_player" align="middle">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
[Code]...
View 1 Replies
Sep 29, 2008
I'm trying to retrieve values that are embedded in the object tag on the HTML page. Is this possible? I've been trying to find how to do this, but all hits point out to how to embed flash in HTML and rarely do I find on which tells me how to retrieve data from HTML into flash.
Example:
Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
[Code].....
How can I simply trace the value in flash??? Just for now, all I want to know is if I make a dynamic text box in flash, can it display the name of the .swf by reading the param?
View 4 Replies
Jan 11, 2011
I have a problem showing up a SWF file (Flash) in an ASP MVC file.I have problems adjusting the height to 100%. If this is showed in Firefox or Opera the result is the picture you see below (everything works fine under Chrome and IE).[code]
View 1 Replies
Feb 27, 2010
how can i cycle thru a local folder to add all (or some) files names and references to that file in an array using actionscript 3.0?
var fileArray:Array = new Array();
for (var item:Object in "../myFolder/")
{
[code].....
View 1 Replies
Jul 9, 2010
I have a custom Flex Container component written in AS3, called StatisticsContainer. When used in the application, it contains various custom Label components called StatisticsBoxes. So there might be a StatisticsContainer containing 3 StatisticsBoxes: "averageAge", "divorceRate" and "infantMortalityRate".
The StatisticsContainer needs to be able to reference and operate on all the StatisticsBoxes. However I don't want to hard-code the references into StatisticsContainer, as there will be various different instances of StatisticsContainer with different StatisticsBoxes in them. So how do I dynamically give StatisticsContainer an ArrayCollection of all the StatisticsBoxes it contains?
So far I started with a function like this in the creationComplete of StatisticsContainer:
[Code]...
View 2 Replies
Mar 25, 2012
I worked with HaXe and actionscript programming, but I'm new to flex. Here's my question. If I want to get image from server (blazeds) in AS3 I'll load it to Loader a loader and then add it to some e.g. MovieClip. Should I do the same to load an image in flex? Or there some common for flex schema for doing that? Another question is. If I have an Image on blazeds server what will a better way to get it: to pass it through java (i.e. read it, and then pass to client) or directcly with Loader?
View 2 Replies
Aug 18, 2009
I have a Flex application embedded in a Flash application, which was working fine and currently works fine if not embedded. As of last Friday, when embedded the Alerts do not show (no error, just nothing), DateField Calendar dropdowns do not show (null value reference of DateField), and dynamically showing the busy cursor errors (null value reference). My code for the Flex app did not change, and I can't think of any reason outside of Flash Player updates (which I think unlikely) or something has changed in the Flash application that is embedding it.
View 1 Replies
Nov 6, 2009
getting data from a database and displaying it in a Flex (Flash) swf. Currently I have some C# code that gets the data from the DB and saves it to an XML file on my site. Then the .swf reads that xml file.
protected void Page_Load(object sender, EventArgs e)
{
DataTable _dt = new DataTable();
_dt = ProductList.GetProductssForAdmin(10);
[code]....
View 4 Replies
Jan 17, 2011
I have the following Actionscript code in my Flex 4 app to display images on a Sprite. Works perfect in the local flash player while developing this:
private function initializePhoto():void {
var photoLoader:Loader = new Loader();
photoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onPhotoReady);
[code].....
View 2 Replies
Aug 27, 2006
I've been trying to find an elegant way to display MovieClip symbols from a Flash 9 swf in a Flex app. I am rewriting my old game ChipWits (google it) and have a bunch of graphics which I need to repeat for walls, floors... All the graphics are in Symbols with auto-generated classes (coffee class for the coffee symbol).I have it working in a very inelegant manner by putting named instances of each of the Symbols on the stage. In Flex I call a function in the swf's Document class that moves the symbol to 0,0 and makes it visible in the swf:
private var mc_Item:MovieClip = null;
public function showInstanceInSWF(itemName:String):void {
// If it has the property draw it[code].....
and then to take the MovieClip and addChild it in my app outside the loaded SWF.This has me pulling my hair out. I am breaking my swf's up so there is one symbol in each, but again this is very kludgy.
View 1 Replies
Sep 12, 2010
I need to update the dynamic text in this flash file I have and export it to SWF. I've looked at the actionscript in all the frames and symbols but the only thing I've found so far are "stop();" 's
I tried exporting this to SWF to see if the file size was the same as the current working version on the site, and it was about 15kb smaller, and does not work at all.
How can I see all external file references in flash? I need to be able to tell my boss which files are needed or at least what is missing.
View 5 Replies
Dec 15, 2011
In my flex 3.5 project, I have a class (MyItem) extending Canvas. In this I have declared a private variable named itemInfo which is type of ItemInfo (which is another subclass of Canvas).
I wrote code to hide/show the iteminfo when the mouse is over/out of MyItem. I am not getting any error but it is not showing the itemInfo as expected, when debugged the code, surprisingly the variables tab in debug window does not have the variable itemInfo at all.
I have declared a dummy:int variable and it is also not visible.
View 2 Replies
Aug 29, 2011
I understand how weak references work, but I am bit confused regarding it's use in actionscript event listeners. Consider the example below:
public class Rectangle extends MovieClip {
public function Rectangle() {
var screen:Shape=new Shape();
[code]...
If the Rectangle object has no other references, then it is a candidate for garbage collection, but since there is an event listener within the object, the event dispatcher holds a reference to the object, even though there are no other references to the object(other than the one held by the event listener). Hence it is prevented from being garbage collected. Is this the reason why weak event listeners are prescribed? Is the flash player so naive that, it cannot figure out that the event listener is defined within the same object?
View 1 Replies