Adobe Dreamweaver Forums



Last 10 THreads :         Strip EXIF camera data from PSD files? (Last Post : Russell_Proulx@adobeforums.com - Replies : 2 - Views : 3 )           »          CSH Calls for Merged CHM's (Last Post : TrentSnake - Replies : 0 - Views : 1 )           »          Image Replacement (Last Post : WhatNow - Replies : 0 - Views : 1 )           »          Embedding Flash SWF Skin in External Site (Last Post : QADesign - Replies : 0 - Views : 1 )           »          Compatible issue with ie6 (Last Post : zhtjlong - Replies : 0 - Views : 1 )           »          Re: Photoshop CS4 is a disaster (Last Post : Paulo_Skylar@adobeforums.com - Replies : 0 - Views : 1 )           »          Query question/help (Last Post : trojnfn - Replies : 2 - Views : 3 )           »          CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 4 - Views : 9 )           »          Bridge No Longer Rotates Automatically (Last Post : Michael_Palumbo@adobeforums.com - Replies : 1 - Views : 2 )           »          dollarFormat / numberformat problem (Last Post : izdabye - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:37 AM
Athas1980
 
Posts: n/a
Diggs:
Default Dynamically creating states causes a memory leak.

Hi

I've created a custom component that all children elements of are dynamically
created. Adding a new child to this component will cause all other children to
move and or resize. I am using states to animate this resize or movement.

Whenever someone resizes the window, drags and drops a component adds or
removes a component I need to animate this process. I'm creating states on the
fly and adding them to the states array. This means however that the states
array will fill up.

I tried doing the following.

however that means that I can't set the state to tempstate again as this is
the current state name.

My working example requires that each state is given a unique name.

However trying to pop the state off the states array give me an error when I
navigate to the next state. So I just didn't remove the state. However since
the state is one shot doesn't that mean I'm just filling up memory with
something that isn't necessary?

Is there any work arround for this. Or do my animations even need states to
function? (just Move and Resize effects)

Thanks for any light you may shed on this matter.
---------------------------------------
OFF TOPIC

When adding an element to the beginning of an array I tend to reverse the
array, push the element and then reverse again. Is this really the best way of
doing things?


var state:State= new State
state.name="tempstate"
// set state properties here.

currentState="tempstate";
//will never navigate to this state again so safe to remove it.
states.pop()



Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 04:04 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk