pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

ActionScript pastebin - collaborative debugging tool View Help


Posted by JesterXL on Tue 13 May 02:40
report abuse | download | new post

  1. package
  2. {
  3.         // here strictly to allow ProgramVO's to work in a Flash CS3
  4.         // List.  It arrogantly assumes that people don't mind
  5.         // adding properties to their VO's.  Rather than modify
  6.         // our data model to work within a CS3 List, we make a new
  7.         // VO.
  8.         //
  9.         // If you're not as much as an OOP Purist as I am,
  10.         // then simply add these properties to the ProgramVO class.
  11.        
  12.         import com.multicastmedia.vidego.vo.ProgramVO;
  13.        
  14.         import flash.utils.Proxy;
  15.         import flash.utils.flash_proxy;
  16.        
  17.         public class ProgramVOProxy extends Proxy
  18.         {
  19.                 public var icon:*;
  20.                 public var label:*;
  21.                 public var program:ProgramVO;
  22.                
  23.                 public function ProgramVOProxy(program:ProgramVO):void
  24.                 {
  25.                         this.program = program;
  26.                 }
  27.                
  28.                 flash_proxy override function getProperty(name:*):*
  29.                 {
  30.                         // if you need the original program, here you go!
  31.                         if (name == "program")
  32.                         {
  33.                                 return program;
  34.                         }
  35.                        
  36.                         // Rather than be a jerk, we attempt to give the List control
  37.                         // a valid label
  38.                         if (name == "label")
  39.                         {
  40.                                 return program.metadatas.title;
  41.                         }
  42.                        
  43.                         // As long as you aren't asking for 'icon',
  44.                         // we'll assume you're looking for ProgramVO data
  45.                         if (name != "icon")
  46.                         {
  47.                                 return program[name];
  48.                         }
  49.                         else
  50.                         {
  51.                                 //... otherwise, it might be here... :: shrugs ::
  52.                                 // if not, BOOM!
  53.                                 return this[name];
  54.                         }
  55.                 }
  56.  
  57.                 flash_proxy override function setProperty(name:*, value:*):void
  58.                 {
  59.                         if (name == "program")
  60.                         {
  61.                                 program = value;
  62.                         }
  63.                        
  64.                         if (name != "icon" && name != "label")
  65.                         {
  66.                                 program[name] = value;
  67.                         }
  68.                         else
  69.                         {
  70.                                 this[name] = value;
  71.                         }
  72.                 }
  73.                
  74.         }
  75. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post