« [OT] E3 or Bust, first born for tickets | Main | [JOBS] Work for me from home! »

May 23, 2007

[Flash Quirks] Combo Box Dropdown can’t be removed and breaks getNextHighestDepth

Maybe this is a well known issue, but for me, I try avoid the V2 components from Flash 8 because they seem to cause more problems then they are worth (not to mention the file size bloat). So I usually end up writing component frameworks for my clients or sale them some of my home baked sets. That’s not to knock the hardworking developers who worked on the V2 components, to quote President Theodore Roosevelt:

“It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood, who strives valiantly; who errs and comes short again and again; because there is not effort without error and shortcomings; but who does actually strive to do the deed; who knows the great enthusiasm, the great devotion, who spends himself in a worthy cause, who at the best knows in the end the triumph of high achievement and who at the worst, if he fails, at least he fails while daring greatly. So that his place shall never be with those cold and timid souls who know neither victory nor defeat.”

But I digress . . .

So I’m working on a project where we used the V2 combo box and hit a funky issue where an opened combo box’s drop down would remain on stage if the combo box was opened and then the component was removed via removeMovieClip.

We also hit what we thought was another unrelated issue where we lost the ability to remove movieclips that had been laid out in the Flash IDE. For those who don’t know, Movieclips placed on the timeline are given negative depth values that can not be removed without first swaping depth to a positive depth value.

After some digging and mucking around it turns out the combo box attaches a dropdown list component to _root at the highest possible depth (thus breaking our stageMC.swapDepths.getNextHighestDepth()).removeMovieClip() method and because it isn’t apart of the component (encapsulation is good) it gets abandoned all by its lonesome.

The solution:

myComboBox._lookroot = true;

The End

PS: for those wondering of my lack of updates we can thank the spamers who have killed my comments, email and even hacked into my cgi bin.

Posted by erikbianchi at May 23, 2007 07:40 AM

Comments

Post a comment




Remember Me?