PhotoshopCallback

Discussion of actual or possible Bugs, Anomalies and Documentation Errors

Moderators: xbytor, DavideBarranca, Paul MR

david

PhotoshopCallback

Postby david » Tue Jul 14, 2009 2:03 am

This is a bit of code from the Panel Developer's Guide's "color picker" sample:

Code: Select all
public function PhotoshopCallback(eventID:Number, descID:Number):void{
   if(eventID == charToInteger("setd") || eventID == charToInteger("Rset")){
      getPSForeground();
      getPSBackground();
   }
}



I added a counter to see how many times this function is called:

Code: Select all
public function PhotoshopCallback(eventID:Number, descID:Number):void{
   if(eventID == charToInteger("setd") || eventID == charToInteger("Rset")){
      count++;
      text1.text=count.toString();
      getPSForeground();
      getPSBackground();
   }
}



The first time I open the panel, every time I change the foreground or background color, the counter increments by one. If I close/minimize the panel and open it again, every time I change foreground or background color, the counter increments by two. The increment gets bigger by one as I close/open the panel.

It appears that closing the panel doesn't remove whatever listeners are attached to Photoshop. Could I modify the code so this wouldn't happen?



Mike Hale

PhotoshopCallback

Postby Mike Hale » Wed Sep 23, 2009 9:18 pm

Is your panel persistent? If so closing the panel doesn't really close it.

If not you could try adding a window.close event to unregister the events.


Return to “Flex, Flash & CS SDK Bugs and Anomalies”

Who is online

Users browsing this forum: No registered users and 1 guest