[Re: [Flashcoders] DK - redrawing interface elements after destruction]

2006-08-11 Thread Bbt Lists

Anthony Lee wrote:



At any rate - when i create my thumbnails, all works fine the first 
time, but after they have been wiped out, and I recall my method to 
re-draw the thumbnails, for some reason my buttons are not working. 
Now I did a bunch of tracing tests to see if:

Hi dnk,

This may not be a proper answer to your question, but when faced with 
this kind of headache I stick all the problem buttons, thumbnails etc 
in a single movieclip, delete that clip to clear them, and redraw the 
whole thing from scratch. Bad for the processor, good for my sanity.


Tony


Ok - as an update I realized why this was not working - my buttons were being 
wiped out and recreated,
but the original delegates (onPress) were the issue. When my class was 
initialized the delegates were
calling their respective functions as it should. The issue I had was that when 
the 2nd page of thumbnails
were loaded - the buttons were still listening to hte original delegate functions. I have written those 
functions to use variables to load the images - but it seems that when the functions used by delegate - had

not updated the variables.. it seemed to only want to do that on the initial 
load. I hope i am explaining this properly.
For the way I seem to think about code - it would be nice if there was a way to 
write dynamic functions. But that is another posting.




--
dnk

___
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


Re: [Flashcoders] DK - redrawing interface elements after destruction

2006-08-10 Thread Anthony Lee


At any rate - when i create my thumbnails, all works fine the first 
time, but after they have been wiped out, and I recall my method to 
re-draw the thumbnails, for some reason my buttons are not working. 
Now I did a bunch of tracing tests to see if:

Hi dnk,

This may not be a proper answer to your question, but when faced with 
this kind of headache I stick all the problem buttons, thumbnails etc in 
a single movieclip, delete that clip to clear them, and redraw the whole 
thing from scratch. Bad for the processor, good for my sanity.


Tony
___
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


Re: [Flashcoders] DK - redrawing interface elements after destruction

2006-08-10 Thread dnk

Anthony Lee wrote:


At any rate - when i create my thumbnails, all works fine the first 
time, but after they have been wiped out, and I recall my method to 
re-draw the thumbnails, for some reason my buttons are not working. 
Now I did a bunch of tracing tests to see if:

Hi dnk,

This may not be a proper answer to your question, but when faced with 
this kind of headache I stick all the problem buttons, thumbnails etc 
in a single movieclip, delete that clip to clear them, and redraw the 
whole thing from scratch. Bad for the processor, good for my sanity.


Tony
Well that is essentially what I am doing. Although my code writes a 
bunch of empty MC's and then removes them after - and then tries to 
recreate it.



create (simplified):

for (var i:Number = 0; i  35; i++) {
//create empty MC's to hold reg. buttons (non components)
this._targetMc.slidemenu.createEmptyMovieClip(btn_mc + i, 
this._targetMc.slidemenu.getNextHighestDepth());

//create loaders for thumbnails.
this._targetMc.slidemenu.createObject(Loader, theThumb + i, 
this._targetMc.slidemenu.getNextHighestDepth());

//create the actual btns from my library into the empty MC's
this._targetMc.slidemenu[btn_mc + i].createObject(HitDk, theHit + 
i, this._targetMc.slidemenu[btn_mc + i].getNextHighestDepth());

//add content to loaders
this._targetMc.slidemenu[theThumb + i].contentPath = this.baseURL + 
myThumb;

}

remove (simplified):

for (var i:Number = 0; i  35; i++) {
//remove the loader components
this._targetMc.slidemenu.destroyObject(theThumb + i);
//unload the MC's containing my non-component btns
this._targetMc.slidemenu[btn_mc + i].unloadMovie();
}

Now like i said - the 2nd time it runs the create portion, everything is 
messed up - which makes no sense to me. I mean if it worked the first 
time, why not a second? The only thing I can think of is it by chance 
the objects are not actually removed (even though a visual test says 
they are).


ideas?


Thanks.

d



___
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