[Flashcoders] Zombie symbol - can't get rid of some text

2007-05-08 Thread Michael King

Hey all,

I know this is more of  a flash question than an actionscript question, but
it's sorta related.

Anyway, at one time (a few versions back), I had some static text across
the top of the scene, in its own layer.

I moved it off the stage to test dynamically displaying the text (the movie
ended up becoming multi-purpose, so instead of re-inventing the wheel, I
came up with a solution using query variables)

And now, the text is there when I publish it, even though I've deleted the
text object, a symbol version of it AND the layer it was on.  I had
understood anything off of the stage wouldn't be displayed, but I'm sure
that's a checkbox I'm missing.

In any event, with or without hiding the off stage area, how come I can't
get rid of this text? It shows up about where I originally moved it to for
the testing, way above the scene, but it's not in the FLA that I can see.

Is there something else I'm missing?  Maybe some extraneous object files
that I should delete?  I can't find anything other than the SWF, FLA and
HTML files in my publishing folder and it's frustrating me to no end.

Help?

Thanks,

Michael King
CSIRT - Developer
Security Incident Response Group
Humana Inc.
E-mail: [EMAIL PROTECTED]
STANDS: Some Theoretical Acronym Not Described Sufficiently

The information transmitted is intended only for the person or entity to which 
it is addressed and may contain CONFIDENTIAL material.  If you receive this 
material/information in error, please contact the sender and delete or destroy 
the material/information.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] setInterval woes

2007-04-20 Thread Michael King

Hey all,

Some of you may remember my problems with visually mapping streaming data
before.  I ended up needing them as separate clips to provide individual
roll-over support with the ability to add links in a future revision.

Well, now that I have it performing better, I'm breaking down the
information into intervals of 1 minute bursts.  What I'm trying to do is
use setInterval to have it pull the data once per minute.

The problem is, when I use setInterval as documented, it waits the first
minute, does its thing, but then it ignores the interval after that,
pulling the data every time that frame comes up.


Here's the relevant bit of code:

function intervalLoop() {
  xmlData = new XML();
  xmlData.load(wddx.php);
  xmlData.onLoad = function () {
wddx = new Wddx();
_root.wddxObj = wddx.deserialize(this);
delete(xmlData);
  }

  for (j=0; j  _root.lines.length; j++) {
trace(Deleting clip:  + _root.lines[j][pen]._name);
_root.lines[j][pen].removeMovieClip();
delete(_root.lines[j][pen]);
delete(_root.lines[j][timestamp]);
_root.lines.splice(j,1);
  }

  for (var i in _root.wddxObj) {
_root.counter++;
date_now = new Date();
pen = createEmptyMovieClip(curve_ + i + _mc, 2 +
_root.counter);
trace(Added clip:  + pen._name);
pen.lineStyle(1.5,0xFF6600);
container = {pen: pen, timestamp: date_now};
_root.lines.push(container);
dest_long = _root.wddxObj[i][long];
dest_lat = _root.wddxObj[i][lat];
site = _root.wddxObj[i][site];
src_long = _root.locations[site][long];
src_lat = _root.locations[site][lat];
curvePoint(pen, src_long, src_lat, dest_long, dest_lat);
  }
}

setInterval(intervalLoop, 6);

Thanks,


Michael King
CSIRT - Developer
Security Incident Response Group
Humana Inc.
E-mail: [EMAIL PROTECTED]
STANDS: Some Theoretical Acronym Not Described Sufficiently

The information transmitted is intended only for the person or entity to which 
it is addressed and may contain CONFIDENTIAL material.  If you receive this 
material/information in error, please contact the sender and delete or destroy 
the material/information.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] actionscript/flash performance

2007-03-27 Thread Michael King
Hey all,

I finally have a question to ask!

I'm working on a project that, in simplest terms, is an event visualizer. 
It takes event data coming in from an XMLSocket (or a standard PHP script 
pulling from a database for replays), creates an empty movie clip, 
stores it in a simple object/array combination to aide in timestamping, 
then it uses removeMovieClip() to discard the clip when it's a minute or 
so old.

Warning, I'm a complete noob when it comes to ActionScript, I have a 
little bit of Javascript experience, and a good amount of PERL and Python, 
so I can handle criticisms, and hopefully they can be explained in a 
language I understand. :)

I have three keyframes, 1, 2 and 20, with 20 being the loop back to give 
me a nearly one second tick mark, when things are not overloaded.

At 1, I instantiate an Array (_root.lines), import WDDX, and create a 
custom function on the MovieClip prototype for some initial markers, along 
with a few longitude/latitude-to-map-coordinates functions, and a function 
for drawing curved vectors.  I initialize some starting points for some 
global counters on _root here, as well.  Lastly, there's a map of the 
globe for the scene background, and the custom function marks three 
locations on the map.

At 2, I populate the initial location marks at level 1, calculate the 
current date/time by instantiating Date(), and store the results on _root 
for later retrieval (we'll call it _root.ratio_start).  I then pull in the 
data stream, currently I limit it to 2500 lines (events, really, it can be 
a little more than 500 characters in XML per event).  I calculate the 
start point (one of the three marks) based on the data provided, then use 
the latitude and longitude calculate an end point.  Here's the part I'm 
not sure is the most efficient:

// Increment the counter to give us a pseudo-unique number.
_root.counter++;
// make a timestamp
date_now = new Date();
// make an empty movie clip with a unique, but dynamic, name
pen = createEmptyMovieClip(vector_ + root.counter + _mc, 
root.counter+2);
// Set the line style
pen.lineStyle(2,0x00CC00);
// Store it in a simple object for later retrieval and timestamp 
comparison
container = {pen: pen, timestamp: date_now);
// Pus it into the lines array.
_root.lines.push(container);
// Draw the vector
curvePoint(pen, x, y, x, y);


From there, it just moves along with no more code until I get to frame 20:

// make a timestamp
date_now = new Date();
// Get the benchmark up until this point
_root.ratio_end = date_now;
// Calculate the ratio between the time it actually took, and one second, 
for throttling purposes
_root.ratio = 1000 / (_root.ratio_end.getTime() - 
_root.ratio_start.getTime());
// _root.millisecondsToMinute = 1000 * 60, get the fraction  (multiple) of 
1 minute.
_root.timeLimit = _root.millisecondsToMinute * _root.ratio;
temp_count = 0;

for (i = 0; i  _root.lines.length; i++) {
// Calculate the difference between the current time, and the time 
this line was turned into a clip.
timeDiff = date_now.getTime() - 
_root.lines[i].timestamp.getTime();
if (timeDiff  _root.timeLimit) {
// Keep track of how many we remove for debugging 
purposes.
temp_count++;
// Remove the movie clip the only way I know how.
_root.lines[i].pen.removeMovieClip();
// remove this entry from the array.
_root.lines.splice(i,1);
}
}

// Occasionally reset the unique counter
if (_root.counter = 32000) {
_root.counter = 0;
}

// Loop back to frame 2, pull more data, etc.
_root.gotoAndPlay(2);


Now, on to my actual question/comment.  I've noticed that if the rate of 
incoming data goes above about 2200, it fails to keep up with the 
throttling, and will start to bog down.  It will remove more than it's 
bringing in, and eventually stablize to about a 3400 total clips in the 
array at the end of each loop.  However, this takes updates down to once 
every 11 seconds or so, defeating the point of a once-per-second refresh 
rate.  If I can't get this to work more efficiently in flash, I'll likely 
have to switch to another platform and language. :/

Is there something I could do that would be more efficient?  I need to be 
able to remove the vectors when they're about a minute old, but I couldn't 
seem to find any other way than to store the clip and date object on 
another, simple object, and store that in an array.  A stack of sorts. I'd 
rather have a way of just using a single clip for all of the vectors, but 
again, I couldn't seem to find a way to remove a line I just drew.  My 
curvePoint() function actually uses curveTo() if that helps.

The throttling works well, but only, again, up until about a 2200 
new-clips-per-second rate.


Thanks!


Michael King
CSIRT - Developer
Security Incident Response Group
Humana Inc.
E-mail: [EMAIL PROTECTED]
STANDS: Some Theoretical Acronym Not Described Sufficiently

Re: [Flashcoders] actionscript/flash performance

2007-03-27 Thread Michael King
Hello,

Thanks for the response.  So by using prototype, I could set the date on 
it, and at the very least get rid of the simple object I'm creating for 
the array, and just go directly to the array?

Something like:

MovieClip.prototype.age = new Date(); 

Or is there something else I need to do to make sure it has an increasing 
date with each loop?

As to the XML data being asynchronous, so you mean I don't actually have 
to use gotoAndPlay()?  I can just start off with a stop(); and set up the 
event code?

I did it the way it is now because I need to use the code with two 
possible ways - an XML packet from a socket, or an XML request from a PHP 
script hitting a MySQL backend (this would facilitate replaying events, 
whereas the socket would be the live-events-as-they-happen version).

Again, thanks for the response, I'm hoping I can keep this in Flash, as it 
presents a wonderful way to have multiple clients viewing the same data, 
with a much smaller effect on the server than other methods -- I also 
don't know C/C++ very well. :)


Thanks,

Michael King
CSIRT - Developer
Security Incident Response Group
Humana Inc.
E-mail: [EMAIL PROTECTED]
STANDS: Some Theoretical Acronym Not Described Sufficiently



[p e r c e p t i c o n] [EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
03/27/2007 01:43 PM
Please respond to
flashcoders@chattyfig.figleaf.com


To
flashcoders@chattyfig.figleaf.com
cc

Subject
Re: [Flashcoders] actionscript/flash performance






Hi Michael,
one thing that stands out right away is the use of prototype...if i'm not
mistaken, this will make these variables available to all movie 
clips...even
ones that don't use the markers you're speaking of...the other thing is 
that
loading of xml data is asynchronous, so you just burning cycles by looping
this way...i would use set interval to manage the removal of the clips
...it's far more efficient...

just my .02




The information transmitted is intended only for the person or entity to which 
it is addressed and may contain CONFIDENTIAL material.  If you receive this 
material/information in error, please contact the sender and delete or destroy 
the material/information.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com