├── LICENSE ├── README.md ├── VERSION ├── asdoc ├── all-classes.html ├── all-index-A.html ├── all-index-B.html ├── all-index-C.html ├── all-index-D.html ├── all-index-E.html ├── all-index-F.html ├── all-index-G.html ├── all-index-H.html ├── all-index-I.html ├── all-index-J.html ├── all-index-K.html ├── all-index-L.html ├── all-index-M.html ├── all-index-N.html ├── all-index-O.html ├── all-index-P.html ├── all-index-Q.html ├── all-index-R.html ├── all-index-S.html ├── all-index-T.html ├── all-index-U.html ├── all-index-V.html ├── all-index-W.html ├── all-index-X.html ├── all-index-Y.html ├── all-index-Z.html ├── appendixes.html ├── asdoc.js ├── class-summary.html ├── cookies.js ├── images │ ├── collapsed.gif │ ├── detailHeaderRule.jpg │ ├── detailSectionHeader.jpg │ ├── expanded.gif │ ├── inherit-arrow.gif │ ├── inheritedSummary.gif │ ├── logo.jpg │ ├── titleTableBottom.jpg │ ├── titleTableMiddle.jpg │ └── titleTableTop.jpg ├── index-list.html ├── index.html ├── mxml-tags.html ├── org │ └── puremvc │ │ └── as3 │ │ ├── core │ │ ├── Controller.html │ │ ├── Model.html │ │ ├── View.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ ├── interfaces │ │ ├── ICommand.html │ │ ├── IController.html │ │ ├── IFacade.html │ │ ├── IMediator.html │ │ ├── IModel.html │ │ ├── INotification.html │ │ ├── INotifier.html │ │ ├── IObserver.html │ │ ├── IProxy.html │ │ ├── IView.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ └── patterns │ │ ├── command │ │ ├── MacroCommand.html │ │ ├── SimpleCommand.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ ├── facade │ │ ├── Facade.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ ├── mediator │ │ ├── Mediator.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ ├── observer │ │ ├── Notification.html │ │ ├── Notifier.html │ │ ├── Observer.html │ │ ├── class-list.html │ │ └── package-detail.html │ │ └── proxy │ │ ├── Proxy.html │ │ ├── class-list.html │ │ └── package-detail.html ├── package-frame.html ├── package-list.html ├── package-summary.html ├── print.css ├── style.css └── title-bar.html ├── bin └── PureMVC_AS3_2_0_4.swc └── src ├── org └── puremvc │ └── as3 │ ├── core │ ├── Controller.as │ ├── Model.as │ └── View.as │ ├── interfaces │ ├── ICommand.as │ ├── IController.as │ ├── IFacade.as │ ├── IMediator.as │ ├── IModel.as │ ├── INotification.as │ ├── INotifier.as │ ├── IObserver.as │ ├── IProxy.as │ └── IView.as │ └── patterns │ ├── command │ ├── MacroCommand.as │ └── SimpleCommand.as │ ├── facade │ └── Facade.as │ ├── mediator │ └── Mediator.as │ ├── observer │ ├── Notification.as │ ├── Notifier.as │ └── Observer.as │ └── proxy │ └── Proxy.as └── puremvc-manifest.xml /LICENSE: -------------------------------------------------------------------------------- 1 | * PureMVC AS3 Standard Framework - Copyright © 2006-2012 Futurescale, Inc. 2 | * All rights reserved. 3 | 4 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of Futurescale, Inc., PureMVC.org, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## [PureMVC](http://puremvc.github.com/) ActionScript 3 Standard Framework 2 | PureMVC is a lightweight framework for creating applications based upon the classic [Model-View-Controller](http://en.wikipedia.org/wiki/Model-view-controller) design meta-pattern. This is the specific implementation for the AS3 language, and the reference implementation for [all other PureMVC Ports](http://puremvc.github.com/). It does not support [modular programming](http://en.wikipedia.org/wiki/Modular_programming) since it uses [Singleton](http://en.wikipedia.org/wiki/Singleton_pattern)s as Core actors rather than the [Multiton](http://en.wikipedia.org/wiki/Multiton)s used in the [MultiCore](https://github.com/PureMVC/puremvc-as3-multicore-framework/wiki/) Version. 3 | 4 | * [API Docs](http://puremvc.org/pages/docs/AS3/standard/framework_asdoc/) 5 | * [Unit Tests](https://github.com/PureMVC/puremvc-as3-standard-unittests/wiki) 6 | * [Discussion](http://forums.puremvc.org/index.php?board=26.0) 7 | * [Standard Version Overview Presentation](http://puremvc.tv/#P100) 8 | * [ActionScript Developer's Guide to PureMVC (O'Reilly)](http://oreil.ly/puremvc) 9 | 10 | ## Demos 11 | * For FLEX 12 | * [App Skeleton](https://github.com/PureMVC/puremvc-as3-demo-flex-appskeleton/wiki) 13 | * [Bookstore](https://github.com/PureMVC/puremvc-as3-demo-flex-weborb-bookstore/wiki) 14 | * [Cafe Townsend](https://github.com/PureMVC/puremvc-as3-demo-flex-cafetownsend/wiki) 15 | * [Employee Admin](https://github.com/PureMVC/puremvc-as3-demo-flex-employeeadmin/wiki) 16 | * [File Upload](https://github.com/PureMVC/puremvc-as3-demo-flex-cf-fileupload/wiki) 17 | * [History Panel](https://github.com/PureMVC/puremvc-as3-demo-flex-historypanel/wiki) 18 | * [Index Cards](https://github.com/PureMVC/puremvc-as3-demo-flex-rails-indexcards/wiki) 19 | * [Loadup as Ordered](https://github.com/PureMVC/puremvc-as3-demo-flex-loadupasordered/wiki) 20 | * [Loadup for Assets](https://github.com/PureMVC/puremvc-as3-demo-flex-loadupforassets/wiki) 21 | * [Manifold Roamer](https://github.com/PureMVC/puremvc-as3-demo-flex-manifoldroamer/wiki) 22 | * [Login](https://github.com/PureMVC/puremvc-as3-demo-flex-weborb-login/wiki) 23 | * [Slacker](https://github.com/PureMVC/puremvc-as3-demo-flex-slacker/wiki) 24 | * [Query CFC](https://github.com/PureMVC/puremvc-as3-demo-flex-cf-querycfc/wiki) 25 | * [StopWatch](https://github.com/PureMVC/puremvc-as3-demo-flex-stopwatch/wiki) 26 | * For AIR 27 | * [CodePeek](https://github.com/PureMVC/puremvc-as3-demo-air-codepeek/wiki) 28 | * [HelloPlaybook](https://github.com/PureMVC/puremvc-as3-demo-air-helloplaybook/wiki) 29 | * [RSS Headlines](https://github.com/PureMVC/puremvc-as3-demo-air-rssheadlines/wiki) 30 | * For FLASH 31 | * [Hello Flash](https://github.com/PureMVC/puremvc-as3-demo-flash-helloflash/wiki) 32 | * [Sequential](https://github.com/PureMVC/puremvc-as3-demo-flash-sequential/wiki) 33 | 34 | ## Utilities 35 | * For FLEX, FLASH, or AIR 36 | * [Async Command](https://github.com/PureMVC/puremvc-as3-util-asynccommand/wiki) 37 | * [Async Stub](https://github.com/PureMVC/puremvc-as3-util-asyncstub/wiki) 38 | * [Loadup](https://github.com/PureMVC/puremvc-as3-util-loadup/wiki) 39 | * [State Machine](https://github.com/PureMVC/puremvc-as3-util-statemachine/wiki) 40 | * [Undo](https://github.com/PureMVC/puremvc-as3-util-undo/wiki) 41 | * For FLEX or AIR 42 | * [Deployment Config](https://github.com/PureMVC/puremvc-as3-util-flex-deploymentconfig/wiki) 43 | * For AIR 44 | * [Desktop Citizen](https://github.com/PureMVC/puremvc-as3-util-air-desktopcitizen/wiki) 45 | * [XML Database](https://github.com/PureMVC/puremvc-as3-util-air-xmldatabase/wiki) 46 | 47 | ## Status 48 | Production - [Version 2.0.4](https://github.com/PureMVC/puremvc-as3-standard-framework/blob/master/VERSION) 49 | 50 | ## Platforms / Technologies 51 | * [ActionScript 3](http://en.wikipedia.org/wiki/ActionScript) 52 | * [Flex](http://en.wikipedia.org/wiki/Adobe_flash) 53 | * [Flash](http://en.wikipedia.org/wiki/Adobe_Flex) 54 | * [AIR](http://en.wikipedia.org/wiki/Adobe_Air) 55 | 56 | ## License 57 | * PureMVC AS3 Standard Framework - Copyright © 2006-2012 Futurescale, Inc. 58 | * All rights reserved. 59 | 60 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 61 | 62 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 63 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 64 | * Neither the name of Futurescale, Inc., PureMVC.org, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 65 | 66 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 | -------------------------------------------------------------------------------- /asdoc/all-classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Classes - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | All Classes 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
Controller
Facade
ICommand
IController
IFacade
IMediator
IModel
INotification
INotifier
IObserver
IProxy
IView
MacroCommand
Mediator
Model
Notification
Notifier
Observer
Proxy
SimpleCommand
View
79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /asdoc/all-index-B.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | B Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-J.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | J Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-K.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | K Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-Q.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Q Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-U.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | U Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-W.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | W Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-X.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | X Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-Y.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Y Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/all-index-Z.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Z Index 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
44 |

45 | 49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/appendixes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Appendixes 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 |
 AppendixDescription
39 |

40 | 44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /asdoc/cookies.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2006-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | /** 13 | * Read the JavaScript cookies tutorial at: 14 | * http://www.netspade.com/articles/javascript/cookies.xml 15 | */ 16 | 17 | /** 18 | * Sets a Cookie with the given name and value. 19 | * 20 | * name Name of the cookie 21 | * value Value of the cookie 22 | * [expires] Expiration date of the cookie (default: end of current session) 23 | * [path] Path where the cookie is valid (default: path of calling document) 24 | * [domain] Domain where the cookie is valid 25 | * (default: domain of calling document) 26 | * [secure] Boolean value indicating if the cookie transmission requires a 27 | * secure transmission 28 | */ 29 | function setCookie(name, value, expires, path, domain, secure) 30 | { 31 | document.cookie= name + "=" + escape(value) + 32 | ((expires) ? "; expires=" + expires.toGMTString() : "") + 33 | ((path) ? "; path=" + path : "") + 34 | ((domain) ? "; domain=" + domain : "") + 35 | ((secure) ? "; secure" : ""); 36 | } 37 | 38 | /** 39 | * Gets the value of the specified cookie. 40 | * 41 | * name Name of the desired cookie. 42 | * 43 | * Returns a string containing value of specified cookie, 44 | * or null if cookie does not exist. 45 | */ 46 | function getCookie(name) 47 | { 48 | var dc = document.cookie; 49 | var prefix = name + "="; 50 | var begin = dc.indexOf("; " + prefix); 51 | if (begin == -1) 52 | { 53 | begin = dc.indexOf(prefix); 54 | if (begin != 0) return null; 55 | } 56 | else 57 | { 58 | begin += 2; 59 | } 60 | var end = document.cookie.indexOf(";", begin); 61 | if (end == -1) 62 | { 63 | end = dc.length; 64 | } 65 | return unescape(dc.substring(begin + prefix.length, end)); 66 | } 67 | 68 | /** 69 | * Deletes the specified cookie. 70 | * 71 | * name name of the cookie 72 | * [path] path of the cookie (must be same as path used to create cookie) 73 | * [domain] domain of the cookie (must be same as domain used to create cookie) 74 | */ 75 | function deleteCookie(name, path, domain) 76 | { 77 | if (getCookie(name)) 78 | { 79 | document.cookie = name + "=" + 80 | ((path) ? "; path=" + path : "") + 81 | ((domain) ? "; domain=" + domain : "") + 82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /asdoc/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/collapsed.gif -------------------------------------------------------------------------------- /asdoc/images/detailHeaderRule.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/detailHeaderRule.jpg -------------------------------------------------------------------------------- /asdoc/images/detailSectionHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/detailSectionHeader.jpg -------------------------------------------------------------------------------- /asdoc/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/expanded.gif -------------------------------------------------------------------------------- /asdoc/images/inherit-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/inherit-arrow.gif -------------------------------------------------------------------------------- /asdoc/images/inheritedSummary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/inheritedSummary.gif -------------------------------------------------------------------------------- /asdoc/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/logo.jpg -------------------------------------------------------------------------------- /asdoc/images/titleTableBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/titleTableBottom.jpg -------------------------------------------------------------------------------- /asdoc/images/titleTableMiddle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/titleTableMiddle.jpg -------------------------------------------------------------------------------- /asdoc/images/titleTableTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/asdoc/images/titleTableTop.jpg -------------------------------------------------------------------------------- /asdoc/index-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

Index

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
AN
BO
CP
DQ
ER
FS
GT
HU
IV
JW
KX
LY
MZ
117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /asdoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <body> 46 | 47 | <h2>Frame Alert</h2> 48 | 49 | <p> 50 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 51 | <br> 52 | Link to <a href="package-summary.html">Non-frame version.</a> 53 | 54 | </p> 55 | 56 | </body> 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /asdoc/mxml-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | MXML Only Components - Adobe Flex 2 Language Reference 10 | 11 | 12 | 13 | 14 | 15 | 16 |

MXML Only Components

17 | 18 | <mx:Binding> 19 |
20 | 21 | <mx:Component> 22 |
23 | 24 | <mx:Metadata> 25 |
26 | 27 | <mx:Model> 28 |
29 | 30 | <mx:Script> 31 |
32 | 33 | <mx:Style> 34 |
35 | 36 | <mx:XML> 37 |
38 | 39 | <mx:XMLList> 40 |
41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/core/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.core - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.core 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
Classes
Controller
Model
View
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/core/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.core Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 48 | 49 | 50 | 52 | 53 |
 ClassDescription
 Controller 43 | A Singleton IController implementation.
 Model 47 | A Singleton IModel implementation.
 View 51 | A Singleton IView implementation.
54 |

55 |
56 |

57 | 61 |
62 |
63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/interfaces/ICommand.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.puremvc.as3.interfaces.ICommand 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
Packageorg.puremvc.as3.interfaces
Interfacepublic interface ICommand
ImplementorsMacroCommand, SimpleCommand
44 |

45 | The interface definition for a PureMVC Command. 46 |

47 |

48 | See also 49 |

50 |
51 | INotification 52 |
53 |
54 |
55 |
56 | 57 |
58 |
Public Methods
59 | 60 | 61 | 62 | 63 | 64 | 70 | 71 |
 MethodDefined by
   65 |
66 | execute(notification:INotification):void
67 |
68 | Execute the ICommand's logic to handle a given INotification.
69 |
ICommand
72 |
73 | 77 |
78 | 79 |
Method detail
80 | 81 | 82 | 83 | 84 | 85 |
execute()method
86 |
87 | public function execute(notification:INotification):void

88 | Execute the ICommand's logic to handle a given INotification. 89 | 90 |

Parameters 91 | 92 | 93 | 95 | 96 |
notification:INotification — an INotification to handle. 94 |
97 |
98 |
99 |
100 |
101 |
102 |

103 | 107 |
108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/interfaces/INotifier.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.puremvc.as3.interfaces.INotifier 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
Packageorg.puremvc.as3.interfaces
Interfacepublic interface INotifier
SubinterfacesIFacade
ImplementorsMacroCommand, Mediator, Notifier, Proxy, SimpleCommand
47 |

48 | The interface definition for a PureMVC Notifier. 49 | 50 |

51 | MacroCommand, Command, Mediator and Proxy 52 | all have a need to send Notifications.

53 | 54 |

55 | The INotifier interface provides a common method called 56 | sendNotification that relieves implementation code of 57 | the necessity to actually construct Notifications.

58 | 59 |

60 | The Notifier class, which all of the above mentioned classes 61 | extend, also provides an initialized reference to the Facade 62 | Singleton, which is required for the convienience method 63 | for sending Notifications, but also eases implementation as these 64 | classes have frequent Facade interactions and usually require 65 | access to the facade anyway.

66 | 67 |

68 |

69 | See also 70 |

71 |
72 | IFacade 73 |
74 | INotification 75 |
76 |
77 |
78 |
79 | 80 |
81 |
Public Methods
82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 |
 MethodDefined by
   88 |
89 | sendNotification(notificationName:String, body:Object = null, type:String = null):void
90 |
91 | Send a INotification.
92 |
INotifier
95 |
96 | 100 |
101 | 102 |
Method detail
103 | 104 | 105 | 106 | 107 | 108 |
sendNotification()method
109 |
110 | public function sendNotification(notificationName:String, body:Object = null, type:String = null):void

111 | Send a INotification. 112 | 113 |

114 | Convenience method to prevent having to construct new 115 | notification instances in our implementation code.

116 | 117 |

Parameters 118 | 119 | 120 | 122 | 123 | 124 | 125 | 126 | 127 | 129 | 130 | 131 | 132 | 133 | 134 | 136 | 137 |
notificationName:String — the name of the notification to send 121 |
 
body:Object (default = null) — the body of the notification (optional) 128 |
 
type:String (default = null) — the type of the notification (optional) 135 |
138 |
139 |
140 |
141 |
142 |
143 |

144 | 148 |
149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/interfaces/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.interfaces - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.interfaces 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
Interfaces
ICommand
IController
IFacade
IMediator
IModel
INotification
INotifier
IObserver
IProxy
IView
 
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/interfaces/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.interfaces Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Interfaces
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 48 | 49 | 50 | 52 | 53 | 54 | 56 | 57 | 58 | 60 | 61 | 62 | 64 | 65 | 66 | 68 | 69 | 70 | 72 | 73 | 74 | 76 | 77 | 78 | 80 | 81 |
 InterfaceDescription
 ICommand 43 | The interface definition for a PureMVC Command.
 IController 47 | The interface definition for a PureMVC Controller.
 IFacade 51 | The interface definition for a PureMVC Facade.
 IMediator 55 | The interface definition for a PureMVC Mediator.
 IModel 59 | The interface definition for a PureMVC Model.
 INotification 63 | The interface definition for a PureMVC Notification.
 INotifier 67 | The interface definition for a PureMVC Notifier.
 IObserver 71 | The interface definition for a PureMVC Observer.
 IProxy 75 | The interface definition for a PureMVC Proxy.
 IView 79 | The interface definition for a PureMVC View.
82 |

83 |
84 |

85 | 89 |
90 |
91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/command/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.patterns.command - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.patterns.command 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Classes
MacroCommand
SimpleCommand
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/command/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.patterns.command Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 48 | 49 |
 ClassDescription
 MacroCommand 43 | A base ICommand implementation that executes other ICommands.
 SimpleCommand 47 | A base ICommand implementation.
50 |

51 |
52 |

53 | 57 |
58 |
59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/facade/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.patterns.facade - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.patterns.facade 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
Facade
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/facade/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.patterns.facade Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 |
 ClassDescription
 Facade 43 | A base Singleton IFacade implementation.
46 |

47 |
48 |

49 | 53 |
54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/mediator/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.patterns.mediator - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.patterns.mediator 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
Mediator
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/mediator/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.patterns.mediator Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 |
 ClassDescription
 Mediator 43 | A base IMediator implementation.
46 |

47 |
48 |

49 | 53 |
54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/observer/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.patterns.observer - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.patterns.observer 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
Classes
Notification
Notifier
Observer
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/observer/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.patterns.observer Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 48 | 49 | 50 | 52 | 53 |
 ClassDescription
 Notification 43 | A base INotification implementation.
 Notifier 47 | A Base INotifier implementation.
 Observer 51 | A base IObserver implementation.
54 |

55 |
56 |

57 | 61 |
62 |
63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/proxy/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | org.puremvc.as3.patterns.proxy - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package org.puremvc.as3.patterns.proxy 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
Proxy
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /asdoc/org/puremvc/as3/patterns/proxy/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.puremvc.as3.patterns.proxy Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 |
 ClassDescription
 Proxy 43 | A base IProxy implementation.
46 |

47 |
48 |

49 | 53 |
54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /asdoc/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <body> 20 | 21 | <h2>Frame Alert</h2> 22 | 23 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 24 | <br> 25 | Link to<a href="package-summary.html">Non-frame version.</a> 26 | 27 | </p> 28 | 29 | </body> 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /asdoc/package-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Package List - API Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | Packages 14 |

15 | 16 | 17 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 31 | 32 | 35 | 36 | 37 | 40 | 41 | 42 | 45 | 46 | 47 | 48 | 49 |
org.puremvc.as3.core 18 |
19 |
org.puremvc.as3.interfaces 23 |
24 |
org.puremvc.as3.patterns.command 28 |
29 |
org.puremvc.as3.patterns.facade 33 |
34 |
org.puremvc.as3.patterns.mediator 38 |
39 |
org.puremvc.as3.patterns.observer 43 |
44 |
org.puremvc.as3.patterns.proxy
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /asdoc/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
 PackageDescription
 org.puremvc.as3.core 
 org.puremvc.as3.interfaces 
 org.puremvc.as3.patterns.command 
 org.puremvc.as3.patterns.facade 
 org.puremvc.as3.patterns.mediator 
 org.puremvc.as3.patterns.observer 
 org.puremvc.as3.patterns.proxy 
60 |

61 | 65 |
66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /asdoc/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | //////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // ADOBE SYSTEMS INCORPORATED 5 | // Copyright 2005-2007 Adobe Systems Incorporated 6 | // All Rights Reserved. 7 | // 8 | // NOTICE: Adobe permits you to use, modify, and distribute this file 9 | // in accordance with the terms of the license agreement accompanying it. 10 | // 11 | //////////////////////////////////////////////////////////////////////////////// 12 | */ 13 | 14 | body { 15 | color: #000000; 16 | background: #ffffff; 17 | font-family: "Times New Roman", Times, serif; 18 | font-size: 12pt; 19 | } 20 | a { 21 | text-decoration: none; 22 | color: #000000; 23 | } 24 | pre { 25 | white-space: -moz-pre-wrap; /* Mozilla */ 26 | white-space: -pre-wrap; /* Opera 4-6 */ 27 | white-space: -o-pre-wrap; /* Opera 7 */ 28 | word-wrap: break-word; /* IE */ 29 | } 30 | .titleTableTopNav, .titleTableSubNav, .logoImage { 31 | display: none; 32 | } 33 | .packageFrame { 34 | display: none; 35 | } 36 | .titleTableSubTitle { 37 | font-weight: bold; 38 | } 39 | .classHeaderTableLabel { 40 | padding-right: 10px; 41 | vertical-align: top; 42 | } 43 | .showHideLinks { 44 | display: none; 45 | } 46 | html>body code { 47 | font-size: 10pt; 48 | } 49 | .summaryTableTitle, .detailSectionHeader { 50 | font-size: 14pt; 51 | font-weight: bold; 52 | padding-top: 15px; 53 | padding-bottom: 5px; 54 | } 55 | .summaryTable { 56 | border: 1px solid #000000; 57 | border-collapse: collapse; 58 | width: 100%; 59 | } 60 | .summaryTableDescription { 61 | padding-bottom: 20px; 62 | } 63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol { 64 | border: 1px solid #000000; 65 | } 66 | .summaryTablePaddingCol { 67 | border: 1px solid #000000; 68 | border-right: 0px; 69 | } 70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol { 71 | border: 1px solid #000000; 72 | border-left: 0px; 73 | } 74 | .summaryTableLastCol { 75 | vertical-align: top; 76 | } 77 | .detailHeader { 78 | font-size: 13pt; 79 | padding-top: 100px; 80 | } 81 | .detailHeaderName { 82 | font-weight: bold; 83 | } 84 | .detailHeaderType { 85 | padding-left: 5px; 86 | } 87 | .detailHeaderRule { 88 | background: #FF0000; 89 | } 90 | .seeAlso { 91 | padding-bottom: 20px; 92 | margin-top: -20px; 93 | } 94 | .innertable { 95 | border-collapse: collapse; 96 | } 97 | .innertable td,.innertable th { 98 | border: 1px solid #000000; 99 | padding-left: 5px; 100 | padding-right: 5px; 101 | } 102 | .listing { 103 | font-size: 10pt; 104 | } 105 | .feedbackLink { 106 | display: none; 107 | } 108 | .copyright { 109 | font-size: 10pt; 110 | } -------------------------------------------------------------------------------- /asdoc/title-bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
PureMVC AS3 Framework - [Standard Version] 26 | All Packages | All Classes | Index | No Frames   27 | 30 |

31 |
 
 
51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /bin/PureMVC_AS3_2_0_4.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PureMVC/puremvc-as3-standard-framework/874ec5857f7cda0f616bfcd9a5ddca2c9f87bdb5/bin/PureMVC_AS3_2_0_4.swc -------------------------------------------------------------------------------- /src/org/puremvc/as3/core/Controller.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.core 6 | { 7 | import org.puremvc.as3.core.*; 8 | import org.puremvc.as3.interfaces.*; 9 | import org.puremvc.as3.patterns.observer.*; 10 | 11 | /** 12 | * A Singleton IController implementation. 13 | * 14 | *

15 | * In PureMVC, the Controller class follows the 16 | * 'Command and Controller' strategy, and assumes these 17 | * responsibilities: 18 | *

29 | * 30 | *

31 | * Your application must register ICommands with the 32 | * Controller. 33 | *

34 | * The simplest way is to subclass Facade, 35 | * and use its initializeController method to add your 36 | * registrations. 37 | * 38 | * @see org.puremvc.as3.core.view.View View 39 | * @see org.puremvc.as3.patterns.observer.Observer Observer 40 | * @see org.puremvc.as3.patterns.observer.Notification Notification 41 | * @see org.puremvc.as3.patterns.command.SimpleCommand SimpleCommand 42 | * @see org.puremvc.as3.patterns.command.MacroCommand MacroCommand 43 | */ 44 | public class Controller implements IController 45 | { 46 | 47 | /** 48 | * Constructor. 49 | * 50 | *

51 | * This IController implementation is a Singleton, 52 | * so you should not call the constructor 53 | * directly, but instead call the static Singleton 54 | * Factory method Controller.getInstance() 55 | * 56 | * @throws Error Error if Singleton instance has already been constructed 57 | * 58 | */ 59 | public function Controller( ) 60 | { 61 | if (instance != null) throw Error(SINGLETON_MSG); 62 | instance = this; 63 | commandMap = new Array(); 64 | initializeController(); 65 | } 66 | 67 | /** 68 | * Initialize the Singleton Controller instance. 69 | * 70 | *

Called automatically by the constructor.

71 | * 72 | *

Note that if you are using a subclass of View 73 | * in your application, you should also subclass Controller 74 | * and override the initializeController method in the 75 | * following way:

76 | * 77 | * 78 | * // ensure that the Controller is talking to my IView implementation 79 | * override public function initializeController( ) : void 80 | * { 81 | * view = MyView.getInstance(); 82 | * } 83 | * 84 | * 85 | * @return void 86 | */ 87 | protected function initializeController( ) : void 88 | { 89 | view = View.getInstance(); 90 | } 91 | 92 | /** 93 | * Controller Singleton Factory method. 94 | * 95 | * @return the Singleton instance of Controller 96 | */ 97 | public static function getInstance() : IController 98 | { 99 | if ( instance == null ) instance = new Controller( ); 100 | return instance; 101 | } 102 | 103 | /** 104 | * If an ICommand has previously been registered 105 | * to handle a the given INotification, then it is executed. 106 | * 107 | * @param note an INotification 108 | */ 109 | public function executeCommand( note : INotification ) : void 110 | { 111 | var commandClassRef : Class = commandMap[ note.getName() ]; 112 | if ( commandClassRef == null ) return; 113 | 114 | var commandInstance : ICommand = new commandClassRef(); 115 | commandInstance.execute( note ); 116 | } 117 | 118 | /** 119 | * Register a particular ICommand class as the handler 120 | * for a particular INotification. 121 | * 122 | *

123 | * If an ICommand has already been registered to 124 | * handle INotifications with this name, it is no longer 125 | * used, the new ICommand is used instead.

126 | * 127 | * The Observer for the new ICommand is only created if this the 128 | * first time an ICommand has been regisered for this Notification name. 129 | * 130 | * @param notificationName the name of the INotification 131 | * @param commandClassRef the Class of the ICommand 132 | */ 133 | public function registerCommand( notificationName : String, commandClassRef : Class ) : void 134 | { 135 | if ( commandMap[ notificationName ] == null ) { 136 | view.registerObserver( notificationName, new Observer( executeCommand, this ) ); 137 | } 138 | commandMap[ notificationName ] = commandClassRef; 139 | } 140 | 141 | /** 142 | * Check if a Command is registered for a given Notification 143 | * 144 | * @param notificationName 145 | * @return whether a Command is currently registered for the given notificationName. 146 | */ 147 | public function hasCommand( notificationName:String ) : Boolean 148 | { 149 | return commandMap[ notificationName ] != null; 150 | } 151 | 152 | /** 153 | * Remove a previously registered ICommand to INotification mapping. 154 | * 155 | * @param notificationName the name of the INotification to remove the ICommand mapping for 156 | */ 157 | public function removeCommand( notificationName : String ) : void 158 | { 159 | // if the Command is registered... 160 | if ( hasCommand( notificationName ) ) 161 | { 162 | // remove the observer 163 | view.removeObserver( notificationName, this ); 164 | 165 | // remove the command 166 | commandMap[ notificationName ] = null; 167 | } 168 | } 169 | 170 | // Local reference to View 171 | protected var view : IView; 172 | 173 | // Mapping of Notification names to Command Class references 174 | protected var commandMap : Array; 175 | 176 | // Singleton instance 177 | protected static var instance : IController; 178 | 179 | // Message Constants 180 | protected const SINGLETON_MSG : String = "Controller Singleton already constructed!"; 181 | 182 | } 183 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/core/Model.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.core 6 | { 7 | 8 | import org.puremvc.as3.interfaces.*; 9 | 10 | /** 11 | * A Singleton IModel implementation. 12 | * 13 | *

14 | * In PureMVC, the Model class provides 15 | * access to model objects (Proxies) by named lookup. 16 | * 17 | *

18 | * The Model assumes these responsibilities:

19 | * 20 | * 25 | * 26 | *

27 | * Your application must register IProxy instances 28 | * with the Model. Typically, you use an 29 | * ICommand to create and register IProxy 30 | * instances once the Facade has initialized the Core 31 | * actors.

32 | * 33 | * @see org.puremvc.as3.patterns.proxy.Proxy Proxy 34 | * @see org.puremvc.as3.interfaces.IProxy IProxy 35 | */ 36 | public class Model implements IModel 37 | { 38 | /** 39 | * Constructor. 40 | * 41 | *

42 | * This IModel implementation is a Singleton, 43 | * so you should not call the constructor 44 | * directly, but instead call the static Singleton 45 | * Factory method Model.getInstance() 46 | * 47 | * @throws Error Error if Singleton instance has already been constructed 48 | * 49 | */ 50 | public function Model( ) 51 | { 52 | if (instance != null) throw Error(SINGLETON_MSG); 53 | instance = this; 54 | proxyMap = new Array(); 55 | initializeModel(); 56 | } 57 | 58 | /** 59 | * Initialize the Singleton Model instance. 60 | * 61 | *

62 | * Called automatically by the constructor, this 63 | * is your opportunity to initialize the Singleton 64 | * instance in your subclass without overriding the 65 | * constructor.

66 | * 67 | * @return void 68 | */ 69 | protected function initializeModel( ) : void 70 | { 71 | } 72 | 73 | /** 74 | * Model Singleton Factory method. 75 | * 76 | * @return the Singleton instance 77 | */ 78 | public static function getInstance() : IModel 79 | { 80 | if (instance == null) instance = new Model( ); 81 | return instance; 82 | } 83 | 84 | /** 85 | * Register an IProxy with the Model. 86 | * 87 | * @param proxy an IProxy to be held by the Model. 88 | */ 89 | public function registerProxy( proxy:IProxy ) : void 90 | { 91 | proxyMap[ proxy.getProxyName() ] = proxy; 92 | proxy.onRegister(); 93 | } 94 | 95 | /** 96 | * Retrieve an IProxy from the Model. 97 | * 98 | * @param proxyName 99 | * @return the IProxy instance previously registered with the given proxyName. 100 | */ 101 | public function retrieveProxy( proxyName:String ) : IProxy 102 | { 103 | return proxyMap[ proxyName ]; 104 | } 105 | 106 | /** 107 | * Check if a Proxy is registered 108 | * 109 | * @param proxyName 110 | * @return whether a Proxy is currently registered with the given proxyName. 111 | */ 112 | public function hasProxy( proxyName:String ) : Boolean 113 | { 114 | return proxyMap[ proxyName ] != null; 115 | } 116 | 117 | /** 118 | * Remove an IProxy from the Model. 119 | * 120 | * @param proxyName name of the IProxy instance to be removed. 121 | * @return the IProxy that was removed from the Model 122 | */ 123 | public function removeProxy( proxyName:String ) : IProxy 124 | { 125 | var proxy:IProxy = proxyMap [ proxyName ] as IProxy; 126 | if ( proxy ) 127 | { 128 | proxyMap[ proxyName ] = null; 129 | proxy.onRemove(); 130 | } 131 | return proxy; 132 | } 133 | 134 | // Mapping of proxyNames to IProxy instances 135 | protected var proxyMap : Array; 136 | 137 | // Singleton instance 138 | protected static var instance : IModel; 139 | 140 | // Message Constants 141 | protected const SINGLETON_MSG : String = "Model Singleton already constructed!"; 142 | 143 | } 144 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/ICommand.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | /** 8 | * The interface definition for a PureMVC Command. 9 | * 10 | * @see org.puremvc.as3.interfaces INotification 11 | */ 12 | public interface ICommand 13 | { 14 | /** 15 | * Execute the ICommand's logic to handle a given INotification. 16 | * 17 | * @param note an INotification to handle. 18 | */ 19 | function execute( notification:INotification ) : void; 20 | } 21 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IController.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | /** 8 | * The interface definition for a PureMVC Controller. 9 | * 10 | *

11 | * In PureMVC, an IController implementor 12 | * follows the 'Command and Controller' strategy, and 13 | * assumes these responsibilities: 14 | *

25 | * 26 | * @see org.puremvc.as3.interfaces INotification 27 | * @see org.puremvc.as3.interfaces ICommand 28 | */ 29 | public interface IController 30 | { 31 | 32 | /** 33 | * Register a particular ICommand class as the handler 34 | * for a particular INotification. 35 | * 36 | * @param notificationName the name of the INotification 37 | * @param commandClassRef the Class of the ICommand 38 | */ 39 | function registerCommand( notificationName : String, commandClassRef : Class ) : void; 40 | 41 | /** 42 | * Execute the ICommand previously registered as the 43 | * handler for INotifications with the given notification name. 44 | * 45 | * @param notification the INotification to execute the associated ICommand for 46 | */ 47 | function executeCommand( notification : INotification ) : void; 48 | 49 | /** 50 | * Remove a previously registered ICommand to INotification mapping. 51 | * 52 | * @param notificationName the name of the INotification to remove the ICommand mapping for 53 | */ 54 | function removeCommand( notificationName : String ):void; 55 | 56 | /** 57 | * Check if a Command is registered for a given Notification 58 | * 59 | * @param notificationName 60 | * @return whether a Command is currently registered for the given notificationName. 61 | */ 62 | function hasCommand( notificationName:String ) : Boolean; 63 | } 64 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IFacade.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | 8 | /** 9 | * The interface definition for a PureMVC Facade. 10 | * 11 | *

12 | * The Facade Pattern suggests providing a single 13 | * class to act as a central point of communication 14 | * for a subsystem.

15 | * 16 | *

17 | * In PureMVC, the Facade acts as an interface between 18 | * the core MVC actors (Model, View, Controller) and 19 | * the rest of your application.

20 | * 21 | * @see org.puremvc.as3.interfaces.IModel IModel 22 | * @see org.puremvc.as3.interfaces.IView IView 23 | * @see org.puremvc.as3.interfaces.IController IController 24 | * @see org.puremvc.as3.interfaces.ICommand ICommand 25 | * @see org.puremvc.as3.interfaces.INotification INotification 26 | */ 27 | public interface IFacade extends INotifier 28 | { 29 | 30 | /** 31 | * Register an IProxy with the Model by name. 32 | * 33 | * @param proxy the IProxy to be registered with the Model. 34 | */ 35 | function registerProxy( proxy:IProxy ) : void; 36 | 37 | /** 38 | * Retrieve a IProxy from the Model by name. 39 | * 40 | * @param proxyName the name of the IProxy instance to be retrieved. 41 | * @return the IProxy previously regisetered by proxyName with the Model. 42 | */ 43 | function retrieveProxy( proxyName:String ) : IProxy; 44 | 45 | /** 46 | * Remove an IProxy instance from the Model by name. 47 | * 48 | * @param proxyName the IProxy to remove from the Model. 49 | * @return the IProxy that was removed from the Model 50 | */ 51 | function removeProxy( proxyName:String ) : IProxy; 52 | 53 | /** 54 | * Check if a Proxy is registered 55 | * 56 | * @param proxyName 57 | * @return whether a Proxy is currently registered with the given proxyName. 58 | */ 59 | function hasProxy( proxyName:String ) : Boolean; 60 | 61 | /** 62 | * Register an ICommand with the Controller. 63 | * 64 | * @param noteName the name of the INotification to associate the ICommand with. 65 | * @param commandClassRef a reference to the Class of the ICommand. 66 | */ 67 | function registerCommand( noteName : String, commandClassRef : Class ) : void; 68 | 69 | /** 70 | * Remove a previously registered ICommand to INotification mapping from the Controller. 71 | * 72 | * @param notificationName the name of the INotification to remove the ICommand mapping for 73 | */ 74 | function removeCommand( notificationName:String ): void; 75 | 76 | /** 77 | * Check if a Command is registered for a given Notification 78 | * 79 | * @param notificationName 80 | * @return whether a Command is currently registered for the given notificationName. 81 | */ 82 | function hasCommand( notificationName:String ) : Boolean; 83 | 84 | /** 85 | * Register an IMediator instance with the View. 86 | * 87 | * @param mediator a reference to the IMediator instance 88 | */ 89 | function registerMediator( mediator:IMediator ) : void; 90 | 91 | /** 92 | * Retrieve an IMediator instance from the View. 93 | * 94 | * @param mediatorName the name of the IMediator instance to retrievve 95 | * @return the IMediator previously registered with the given mediatorName. 96 | */ 97 | function retrieveMediator( mediatorName:String ) : IMediator; 98 | 99 | /** 100 | * Remove a IMediator instance from the View. 101 | * 102 | * @param mediatorName name of the IMediator instance to be removed. 103 | * @return the IMediator instance previously registered with the given mediatorName. 104 | */ 105 | function removeMediator( mediatorName:String ) : IMediator; 106 | 107 | /** 108 | * Check if a Mediator is registered or not 109 | * 110 | * @param mediatorName 111 | * @return whether a Mediator is registered with the given mediatorName. 112 | */ 113 | function hasMediator( mediatorName:String ) : Boolean; 114 | 115 | /** 116 | * Notify the IObservers for a particular INotification. 117 | * 118 | *

119 | * All previously attached IObservers for this INotification's 120 | * list are notified and are passed a reference to the INotification in 121 | * the order in which they were registered.

122 | *

123 | * NOTE: Use this method only if you are sending custom Notifications. Otherwise 124 | * use the sendNotification method which does not require you to create the 125 | * Notification instance.

126 | * 127 | * @param notification the INotification to notify IObservers of. 128 | */ 129 | function notifyObservers( note:INotification ) : void; 130 | } 131 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IMediator.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | 8 | /** 9 | * The interface definition for a PureMVC Mediator. 10 | * 11 | *

12 | * In PureMVC, IMediator implementors assume these responsibilities:

13 | * 19 | *

20 | * Additionally, IMediators typically: 21 | *

29 | *

30 | * When an IMediator is registered with the IView, 31 | * the IView will call the IMediator's 32 | * listNotificationInterests method. The IMediator will 33 | * return an Array of INotification names which 34 | * it wishes to be notified about.

35 | * 36 | *

37 | * The IView will then create an Observer object 38 | * encapsulating that IMediator's (handleNotification) method 39 | * and register it as an Observer for each INotification name returned by 40 | * listNotificationInterests.

41 | * 42 | *

43 | * A concrete IMediator implementor usually looks something like this:

44 | * 45 | * 46 | * import org.puremvc.as3.patterns.mediator.~~; 47 | * import org.puremvc.as3.patterns.observer.~~; 48 | * import org.puremvc.as3.core.view.~~; 49 | * 50 | * import com.me.myapp.model.~~; 51 | * import com.me.myapp.view.~~; 52 | * import com.me.myapp.controller.~~; 53 | * 54 | * import mx.controls.ComboBox; 55 | * import mx.events.ListEvent; 56 | * 57 | * public class MyMediator extends Mediator implements IMediator { 58 | * 59 | * public function MyComboMediator( viewComponent:Object ) { 60 | * super( viewComponent ); 61 | * combo.addEventListener( Event.CHANGE, onChange ); 62 | * } 63 | * 64 | * override public function listNotificationInterests():Array { 65 | * return [ MyFacade.SET_SELECTION, 66 | * MyFacade.SET_DATAPROVIDER ]; 67 | * } 68 | * 69 | * override public function handleNotification( notification:INotification ):void { 70 | * switch ( notification.getName() ) { 71 | * case MyFacade.SET_SELECTION: 72 | * setSelection(notification); 73 | * break; 74 | * case MyFacade.SET_DATAPROVIDER: 75 | * setDataProvider(notification); 76 | * break; 77 | * } 78 | * } 79 | * 80 | * // Set the data provider of the combo box 81 | * protected function setDataProvider( notification:INotification ):void { 82 | * combo.dataProvider = notification.getBody() as Array; 83 | * } 84 | * 85 | * // Invoked when the combo box dispatches a change event, we send a 86 | * // notification with the 87 | * protected function onChange(event:ListEvent):void { 88 | * sendNotification( MyFacade.MYCOMBO_CHANGED, this ); 89 | * } 90 | * 91 | * // A private getter for accessing the view object by class 92 | * protected function get combo():ComboBox { 93 | * return view as ComboBox; 94 | * } 95 | * 96 | * } 97 | * 98 | * 99 | * @see org.puremvc.as3.interfaces.INotification INotification 100 | */ 101 | public interface IMediator 102 | { 103 | 104 | /** 105 | * Get the IMediator instance name 106 | * 107 | * @return the IMediator instance name 108 | */ 109 | function getMediatorName():String; 110 | 111 | /** 112 | * Get the IMediator's view component. 113 | * 114 | * @return Object the view component 115 | */ 116 | function getViewComponent():Object; 117 | 118 | /** 119 | * Set the IMediator's view component. 120 | * 121 | * @param Object the view component 122 | */ 123 | function setViewComponent( viewComponent:Object ):void; 124 | 125 | /** 126 | * List INotification interests. 127 | * 128 | * @return an Array of the INotification names this IMediator has an interest in. 129 | */ 130 | function listNotificationInterests( ):Array; 131 | 132 | /** 133 | * Handle an INotification. 134 | * 135 | * @param notification the INotification to be handled 136 | */ 137 | function handleNotification( notification:INotification ):void; 138 | 139 | /** 140 | * Called by the View when the Mediator is registered 141 | */ 142 | function onRegister( ):void; 143 | 144 | /** 145 | * Called by the View when the Mediator is removed 146 | */ 147 | function onRemove( ):void; 148 | 149 | } 150 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IModel.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | /** 8 | * The interface definition for a PureMVC Model. 9 | * 10 | *

11 | * In PureMVC, IModel implementors provide 12 | * access to IProxy objects by named lookup.

13 | * 14 | *

15 | * An IModel assumes these responsibilities:

16 | * 17 | * 21 | */ 22 | public interface IModel 23 | { 24 | /** 25 | * Register an IProxy instance with the Model. 26 | * 27 | * @param proxyName the name to associate with this IProxy instance. 28 | * @param proxy an object reference to be held by the Model. 29 | */ 30 | function registerProxy( proxy:IProxy ) : void; 31 | 32 | /** 33 | * Retrieve an IProxy instance from the Model. 34 | * 35 | * @param proxyName 36 | * @return the IProxy instance previously registered with the given proxyName. 37 | */ 38 | function retrieveProxy( proxyName:String ) : IProxy; 39 | 40 | /** 41 | * Remove an IProxy instance from the Model. 42 | * 43 | * @param proxyName name of the IProxy instance to be removed. 44 | * @return the IProxy that was removed from the Model 45 | */ 46 | function removeProxy( proxyName:String ) : IProxy; 47 | 48 | /** 49 | * Check if a Proxy is registered 50 | * 51 | * @param proxyName 52 | * @return whether a Proxy is currently registered with the given proxyName. 53 | */ 54 | function hasProxy( proxyName:String ) : Boolean; 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/INotification.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | /** 8 | * The interface definition for a PureMVC Notification. 9 | * 10 | *

11 | * PureMVC does not rely upon underlying event models such 12 | * as the one provided with Flash, and ActionScript 3 does 13 | * not have an inherent event model.

14 | * 15 | *

16 | * The Observer Pattern as implemented within PureMVC exists 17 | * to support event-driven communication between the 18 | * application and the actors of the MVC triad.

19 | * 20 | *

21 | * Notifications are not meant to be a replacement for Events 22 | * in Flex/Flash/AIR. Generally, IMediator implementors 23 | * place event listeners on their view components, which they 24 | * then handle in the usual way. This may lead to the broadcast of Notifications to 25 | * trigger ICommands or to communicate with other IMediators. IProxy and ICommand 26 | * instances communicate with each other and IMediators 27 | * by broadcasting INotifications.

28 | * 29 | *

30 | * A key difference between Flash Events and PureMVC 31 | * Notifications is that Events follow the 32 | * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy 33 | * until some parent component handles the Event, while 34 | * PureMVC Notifications follow a 'Publish/Subscribe' 35 | * pattern. PureMVC classes need not be related to each other in a 36 | * parent/child relationship in order to communicate with one another 37 | * using Notifications. 38 | * 39 | * @see org.puremvc.as3.interfaces.IView IView 40 | * @see org.puremvc.as3.interfaces.IObserver IObserver 41 | */ 42 | public interface INotification 43 | { 44 | 45 | /** 46 | * Get the name of the INotification instance. 47 | * No setter, should be set by constructor only 48 | */ 49 | function getName():String; 50 | 51 | /** 52 | * Set the body of the INotification instance 53 | */ 54 | function setBody( body:Object ):void; 55 | 56 | /** 57 | * Get the body of the INotification instance 58 | */ 59 | function getBody():Object; 60 | 61 | /** 62 | * Set the type of the INotification instance 63 | */ 64 | function setType( type:String ):void; 65 | 66 | /** 67 | * Get the type of the INotification instance 68 | */ 69 | function getType():String; 70 | 71 | /** 72 | * Get the string representation of the INotification instance 73 | */ 74 | function toString():String; 75 | } 76 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/INotifier.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | /** 8 | * The interface definition for a PureMVC Notifier. 9 | * 10 | *

11 | * MacroCommand, Command, Mediator and Proxy 12 | * all have a need to send Notifications.

13 | * 14 | *

15 | * The INotifier interface provides a common method called 16 | * sendNotification that relieves implementation code of 17 | * the necessity to actually construct Notifications.

18 | * 19 | *

20 | * The Notifier class, which all of the above mentioned classes 21 | * extend, also provides an initialized reference to the Facade 22 | * Singleton, which is required for the convienience method 23 | * for sending Notifications, but also eases implementation as these 24 | * classes have frequent Facade interactions and usually require 25 | * access to the facade anyway.

26 | * 27 | * @see org.puremvc.as3.interfaces.IFacade IFacade 28 | * @see org.puremvc.as3.interfaces.INotification INotification 29 | */ 30 | public interface INotifier 31 | { 32 | /** 33 | * Send a INotification. 34 | * 35 | *

36 | * Convenience method to prevent having to construct new 37 | * notification instances in our implementation code.

38 | * 39 | * @param notificationName the name of the notification to send 40 | * @param body the body of the notification (optional) 41 | * @param type the type of the notification (optional) 42 | */ 43 | function sendNotification( notificationName:String, body:Object=null, type:String=null ):void; 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IObserver.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | 8 | /** 9 | * The interface definition for a PureMVC Observer. 10 | * 11 | *

12 | * In PureMVC, IObserver implementors assume these responsibilities: 13 | *

19 | * 20 | *

21 | * PureMVC does not rely upon underlying event 22 | * models such as the one provided with Flash, 23 | * and ActionScript 3 does not have an inherent 24 | * event model.

25 | * 26 | *

27 | * The Observer Pattern as implemented within 28 | * PureMVC exists to support event driven communication 29 | * between the application and the actors of the 30 | * MVC triad.

31 | * 32 | *

33 | * An Observer is an object that encapsulates information 34 | * about an interested object with a notification method that 35 | * should be called when an INotification is broadcast. The Observer then 36 | * acts as a proxy for notifying the interested object. 37 | * 38 | *

39 | * Observers can receive Notifications by having their 40 | * notifyObserver method invoked, passing 41 | * in an object implementing the INotification interface, such 42 | * as a subclass of Notification.

43 | * 44 | * @see org.puremvc.as3.interfaces.IView IView 45 | * @see org.puremvc.as3.interfaces.INotification INotification 46 | */ 47 | public interface IObserver 48 | { 49 | /** 50 | * Set the notification method. 51 | * 52 | *

53 | * The notification method should take one parameter of type INotification

54 | * 55 | * @param notifyMethod the notification (callback) method of the interested object 56 | */ 57 | function setNotifyMethod( notifyMethod:Function ):void; 58 | 59 | /** 60 | * Set the notification context. 61 | * 62 | * @param notifyContext the notification context (this) of the interested object 63 | */ 64 | function setNotifyContext( notifyContext:Object ):void; 65 | 66 | /** 67 | * Notify the interested object. 68 | * 69 | * @param notification the INotification to pass to the interested object's notification method 70 | */ 71 | function notifyObserver( notification:INotification ):void; 72 | 73 | /** 74 | * Compare the given object to the notificaiton context object. 75 | * 76 | * @param object the object to compare. 77 | * @return boolean indicating if the notification context and the object are the same. 78 | */ 79 | function compareNotifyContext( object:Object ):Boolean; 80 | } 81 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IProxy.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | 8 | /** 9 | * The interface definition for a PureMVC Proxy. 10 | * 11 | *

12 | * In PureMVC, IProxy implementors assume these responsibilities:

13 | * 17 | *

18 | * Additionally, IProxys typically:

19 | * 26 | */ 27 | public interface IProxy 28 | { 29 | 30 | /** 31 | * Get the Proxy name 32 | * 33 | * @return the Proxy instance name 34 | */ 35 | function getProxyName():String; 36 | 37 | /** 38 | * Set the data object 39 | * 40 | * @param data the data object 41 | */ 42 | function setData( data:Object ):void; 43 | 44 | /** 45 | * Get the data object 46 | * 47 | * @return the data as type Object 48 | */ 49 | function getData():Object; 50 | 51 | /** 52 | * Called by the Model when the Proxy is registered 53 | */ 54 | function onRegister( ):void; 55 | 56 | /** 57 | * Called by the Model when the Proxy is removed 58 | */ 59 | function onRemove( ):void; 60 | } 61 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/interfaces/IView.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.interfaces 6 | { 7 | 8 | /** 9 | * The interface definition for a PureMVC View. 10 | * 11 | *

12 | * In PureMVC, IView implementors assume these responsibilities:

13 | * 14 | *

15 | * In PureMVC, the View class assumes these responsibilities: 16 | *

24 | * 25 | * @see org.puremvc.as3.interfaces.IMediator IMediator 26 | * @see org.puremvc.as3.interfaces.IObserver IObserver 27 | * @see org.puremvc.as3.interfaces.INotification INotification 28 | */ 29 | public interface IView 30 | { 31 | 32 | /** 33 | * Register an IObserver to be notified 34 | * of INotifications with a given name. 35 | * 36 | * @param notificationName the name of the INotifications to notify this IObserver of 37 | * @param observer the IObserver to register 38 | */ 39 | function registerObserver( notificationName:String, observer:IObserver ) : void; 40 | 41 | /** 42 | * Remove a group of observers from the observer list for a given Notification name. 43 | *

44 | * @param notificationName which observer list to remove from 45 | * @param notifyContext removed the observers with this object as their notifyContext 46 | */ 47 | function removeObserver( notificationName:String, notifyContext:Object ):void; 48 | 49 | /** 50 | * Notify the IObservers for a particular INotification. 51 | * 52 | *

53 | * All previously attached IObservers for this INotification's 54 | * list are notified and are passed a reference to the INotification in 55 | * the order in which they were registered.

56 | * 57 | * @param notification the INotification to notify IObservers of. 58 | */ 59 | function notifyObservers( note:INotification ) : void; 60 | 61 | /** 62 | * Register an IMediator instance with the View. 63 | * 64 | *

65 | * Registers the IMediator so that it can be retrieved by name, 66 | * and further interrogates the IMediator for its 67 | * INotification interests.

68 | *

69 | * If the IMediator returns any INotification 70 | * names to be notified about, an Observer is created encapsulating 71 | * the IMediator instance's handleNotification method 72 | * and registering it as an Observer for all INotifications the 73 | * IMediator is interested in.

74 | * 75 | * @param mediatorName the name to associate with this IMediator instance 76 | * @param mediator a reference to the IMediator instance 77 | */ 78 | function registerMediator( mediator:IMediator ) : void; 79 | 80 | /** 81 | * Retrieve an IMediator from the View. 82 | * 83 | * @param mediatorName the name of the IMediator instance to retrieve. 84 | * @return the IMediator instance previously registered with the given mediatorName. 85 | */ 86 | function retrieveMediator( mediatorName:String ) : IMediator; 87 | 88 | /** 89 | * Remove an IMediator from the View. 90 | * 91 | * @param mediatorName name of the IMediator instance to be removed. 92 | * @return the IMediator that was removed from the View 93 | */ 94 | function removeMediator( mediatorName:String ) : IMediator; 95 | 96 | /** 97 | * Check if a Mediator is registered or not 98 | * 99 | * @param mediatorName 100 | * @return whether a Mediator is registered with the given mediatorName. 101 | */ 102 | function hasMediator( mediatorName:String ) : Boolean; 103 | 104 | } 105 | 106 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/command/MacroCommand.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.command 6 | { 7 | 8 | import org.puremvc.as3.interfaces.*; 9 | import org.puremvc.as3.patterns.observer.*; 10 | 11 | /** 12 | * A base ICommand implementation that executes other ICommands. 13 | * 14 | *

15 | * A MacroCommand maintains an list of 16 | * ICommand Class references called SubCommands.

17 | * 18 | *

19 | * When execute is called, the MacroCommand 20 | * instantiates and calls execute on each of its SubCommands turn. 21 | * Each SubCommand will be passed a reference to the original 22 | * INotification that was passed to the MacroCommand's 23 | * execute method.

24 | * 25 | *

26 | * Unlike SimpleCommand, your subclass 27 | * should not override execute, but instead, should 28 | * override the initializeMacroCommand method, 29 | * calling addSubCommand once for each SubCommand 30 | * to be executed.

31 | * 32 | *

33 | * 34 | * @see org.puremvc.as3.core.controller.Controller Controller 35 | * @see org.puremvc.as3.patterns.observer.Notification Notification 36 | * @see org.puremvc.as3.patterns.command.SimpleCommand SimpleCommand 37 | */ 38 | public class MacroCommand extends Notifier implements ICommand, INotifier 39 | { 40 | 41 | private var subCommands:Array; 42 | 43 | /** 44 | * Constructor. 45 | * 46 | *

47 | * You should not need to define a constructor, 48 | * instead, override the initializeMacroCommand 49 | * method.

50 | * 51 | *

52 | * If your subclass does define a constructor, be 53 | * sure to call super().

54 | */ 55 | public function MacroCommand() 56 | { 57 | subCommands = new Array(); 58 | initializeMacroCommand(); 59 | } 60 | 61 | /** 62 | * Initialize the MacroCommand. 63 | * 64 | *

65 | * In your subclass, override this method to 66 | * initialize the MacroCommand's SubCommand 67 | * list with ICommand class references like 68 | * this:

69 | * 70 | * 71 | * // Initialize MyMacroCommand 72 | * override protected function initializeMacroCommand( ) : void 73 | * { 74 | * addSubCommand( com.me.myapp.controller.FirstCommand ); 75 | * addSubCommand( com.me.myapp.controller.SecondCommand ); 76 | * addSubCommand( com.me.myapp.controller.ThirdCommand ); 77 | * } 78 | * 79 | * 80 | *

81 | * Note that SubCommands may be any ICommand implementor, 82 | * MacroCommands or SimpleCommands are both acceptable. 83 | */ 84 | protected function initializeMacroCommand():void 85 | { 86 | } 87 | 88 | /** 89 | * Add a SubCommand. 90 | * 91 | *

92 | * The SubCommands will be called in First In/First Out (FIFO) 93 | * order.

94 | * 95 | * @param commandClassRef a reference to the Class of the ICommand. 96 | */ 97 | protected function addSubCommand( commandClassRef:Class ): void 98 | { 99 | subCommands.push(commandClassRef); 100 | } 101 | 102 | /** 103 | * Execute this MacroCommand's SubCommands. 104 | * 105 | *

106 | * The SubCommands will be called in First In/First Out (FIFO) 107 | * order. 108 | * 109 | * @param notification the INotification object to be passsed to each SubCommand. 110 | */ 111 | public final function execute( notification:INotification ) : void 112 | { 113 | while ( subCommands.length > 0) { 114 | var commandClassRef : Class = subCommands.shift(); 115 | var commandInstance : ICommand = new commandClassRef(); 116 | commandInstance.execute( notification ); 117 | } 118 | } 119 | 120 | } 121 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/command/SimpleCommand.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.command 6 | { 7 | 8 | import org.puremvc.as3.interfaces.*; 9 | import org.puremvc.as3.patterns.observer.Notifier; 10 | 11 | /** 12 | * A base ICommand implementation. 13 | * 14 | *

15 | * Your subclass should override the execute 16 | * method where your business logic will handle the INotification.

17 | * 18 | * @see org.puremvc.as3.core.controller.Controller Controller 19 | * @see org.puremvc.as3.patterns.observer.Notification Notification 20 | * @see org.puremvc.as3.patterns.command.MacroCommand MacroCommand 21 | */ 22 | public class SimpleCommand extends Notifier implements ICommand, INotifier 23 | { 24 | 25 | /** 26 | * Fulfill the use-case initiated by the given INotification. 27 | * 28 | *

29 | * In the Command Pattern, an application use-case typically 30 | * begins with some user action, which results in an INotification being broadcast, which 31 | * is handled by business logic in the execute method of an 32 | * ICommand.

33 | * 34 | * @param notification the INotification to handle. 35 | */ 36 | public function execute( notification:INotification ) : void 37 | { 38 | 39 | } 40 | 41 | } 42 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/mediator/Mediator.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.mediator 6 | { 7 | import org.puremvc.as3.interfaces.*; 8 | import org.puremvc.as3.patterns.observer.*; 9 | import org.puremvc.as3.patterns.facade.Facade; 10 | 11 | /** 12 | * A base IMediator implementation. 13 | * 14 | * @see org.puremvc.as3.core.view.View View 15 | */ 16 | public class Mediator extends Notifier implements IMediator, INotifier 17 | { 18 | 19 | /** 20 | * The name of the Mediator. 21 | * 22 | *

23 | * Typically, a Mediator will be written to serve 24 | * one specific control or group controls and so, 25 | * will not have a need to be dynamically named.

26 | */ 27 | public static const NAME:String = 'Mediator'; 28 | 29 | /** 30 | * Constructor. 31 | */ 32 | public function Mediator( mediatorName:String=null, viewComponent:Object=null ) { 33 | this.mediatorName = (mediatorName != null)?mediatorName:NAME; 34 | this.viewComponent = viewComponent; 35 | } 36 | 37 | /** 38 | * Get the name of the Mediator. 39 | * @return the Mediator name 40 | */ 41 | public function getMediatorName():String 42 | { 43 | return mediatorName; 44 | } 45 | 46 | /** 47 | * Set the IMediator's view component. 48 | * 49 | * @param Object the view component 50 | */ 51 | public function setViewComponent( viewComponent:Object ):void 52 | { 53 | this.viewComponent = viewComponent; 54 | } 55 | 56 | /** 57 | * Get the Mediator's view component. 58 | * 59 | *

60 | * Additionally, an implicit getter will usually 61 | * be defined in the subclass that casts the view 62 | * object to a type, like this:

63 | * 64 | * 65 | * private function get comboBox : mx.controls.ComboBox 66 | * { 67 | * return viewComponent as mx.controls.ComboBox; 68 | * } 69 | * 70 | * 71 | * @return the view component 72 | */ 73 | public function getViewComponent():Object 74 | { 75 | return viewComponent; 76 | } 77 | 78 | /** 79 | * List the INotification names this 80 | * Mediator is interested in being notified of. 81 | * 82 | * @return Array the list of INotification names 83 | */ 84 | public function listNotificationInterests():Array 85 | { 86 | return [ ]; 87 | } 88 | 89 | /** 90 | * Handle INotifications. 91 | * 92 | *

93 | * Typically this will be handled in a switch statement, 94 | * with one 'case' entry per INotification 95 | * the Mediator is interested in. 96 | */ 97 | public function handleNotification( notification:INotification ):void {} 98 | 99 | /** 100 | * Called by the View when the Mediator is registered 101 | */ 102 | public function onRegister( ):void {} 103 | 104 | /** 105 | * Called by the View when the Mediator is removed 106 | */ 107 | public function onRemove( ):void {} 108 | 109 | // the mediator name 110 | protected var mediatorName:String; 111 | 112 | // The view component 113 | protected var viewComponent:Object; 114 | } 115 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/observer/Notification.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.observer 6 | { 7 | import org.puremvc.as3.interfaces.*; 8 | 9 | /** 10 | * A base INotification implementation. 11 | * 12 | *

13 | * PureMVC does not rely upon underlying event models such 14 | * as the one provided with Flash, and ActionScript 3 does 15 | * not have an inherent event model.

16 | * 17 | *

18 | * The Observer Pattern as implemented within PureMVC exists 19 | * to support event-driven communication between the 20 | * application and the actors of the MVC triad.

21 | * 22 | *

23 | * Notifications are not meant to be a replacement for Events 24 | * in Flex/Flash/Apollo. Generally, IMediator implementors 25 | * place event listeners on their view components, which they 26 | * then handle in the usual way. This may lead to the broadcast of Notifications to 27 | * trigger ICommands or to communicate with other IMediators. IProxy and ICommand 28 | * instances communicate with each other and IMediators 29 | * by broadcasting INotifications.

30 | * 31 | *

32 | * A key difference between Flash Events and PureMVC 33 | * Notifications is that Events follow the 34 | * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy 35 | * until some parent component handles the Event, while 36 | * PureMVC Notifications follow a 'Publish/Subscribe' 37 | * pattern. PureMVC classes need not be related to each other in a 38 | * parent/child relationship in order to communicate with one another 39 | * using Notifications. 40 | * 41 | * @see org.puremvc.as3.patterns.observer.Observer Observer 42 | * 43 | */ 44 | public class Notification implements INotification 45 | { 46 | 47 | /** 48 | * Constructor. 49 | * 50 | * @param name name of the Notification instance. (required) 51 | * @param body the Notification body. (optional) 52 | * @param type the type of the Notification (optional) 53 | */ 54 | public function Notification( name:String, body:Object=null, type:String=null ) 55 | { 56 | this.name = name; 57 | this.body = body; 58 | this.type = type; 59 | } 60 | 61 | /** 62 | * Get the name of the Notification instance. 63 | * 64 | * @return the name of the Notification instance. 65 | */ 66 | public function getName():String 67 | { 68 | return name; 69 | } 70 | 71 | /** 72 | * Set the body of the Notification instance. 73 | */ 74 | public function setBody( body:Object ):void 75 | { 76 | this.body = body; 77 | } 78 | 79 | /** 80 | * Get the body of the Notification instance. 81 | * 82 | * @return the body object. 83 | */ 84 | public function getBody():Object 85 | { 86 | return body; 87 | } 88 | 89 | /** 90 | * Set the type of the Notification instance. 91 | */ 92 | public function setType( type:String ):void 93 | { 94 | this.type = type; 95 | } 96 | 97 | /** 98 | * Get the type of the Notification instance. 99 | * 100 | * @return the type 101 | */ 102 | public function getType():String 103 | { 104 | return type; 105 | } 106 | 107 | /** 108 | * Get the string representation of the Notification instance. 109 | * 110 | * @return the string representation of the Notification instance. 111 | */ 112 | public function toString():String 113 | { 114 | var msg:String = "Notification Name: "+getName(); 115 | msg += "\nBody:"+(( body == null )?"null":body.toString()); 116 | msg += "\nType:"+(( type == null )?"null":type); 117 | return msg; 118 | } 119 | 120 | // the name of the notification instance 121 | private var name : String; 122 | // the type of the notification instance 123 | private var type : String; 124 | // the body of the notification instance 125 | private var body : Object; 126 | 127 | } 128 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/observer/Notifier.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.observer 6 | { 7 | import org.puremvc.as3.interfaces.*; 8 | import org.puremvc.as3.patterns.facade.Facade; 9 | 10 | /** 11 | * A Base INotifier implementation. 12 | * 13 | *

14 | * MacroCommand, Command, Mediator and Proxy 15 | * all have a need to send Notifications.

16 | *

17 | * The INotifier interface provides a common method called 18 | * sendNotification that relieves implementation code of 19 | * the necessity to actually construct Notifications.

20 | * 21 | *

22 | * The Notifier class, which all of the above mentioned classes 23 | * extend, provides an initialized reference to the Facade 24 | * Singleton, which is required for the convienience method 25 | * for sending Notifications, but also eases implementation as these 26 | * classes have frequent Facade interactions and usually require 27 | * access to the facade anyway.

28 | * 29 | * @see org.puremvc.as3.patterns.facade.Facade Facade 30 | * @see org.puremvc.as3.patterns.mediator.Mediator Mediator 31 | * @see org.puremvc.as3.patterns.proxy.Proxy Proxy 32 | * @see org.puremvc.as3.patterns.command.SimpleCommand SimpleCommand 33 | * @see org.puremvc.as3.patterns.command.MacroCommand MacroCommand 34 | */ 35 | public class Notifier implements INotifier 36 | { 37 | /** 38 | * Create and send an INotification. 39 | * 40 | *

41 | * Keeps us from having to construct new INotification 42 | * instances in our implementation code. 43 | * @param notificationName the name of the notiification to send 44 | * @param body the body of the notification (optional) 45 | * @param type the type of the notification (optional) 46 | */ 47 | public function sendNotification( notificationName:String, body:Object=null, type:String=null ):void 48 | { 49 | facade.sendNotification( notificationName, body, type ); 50 | } 51 | 52 | // Local reference to the Facade Singleton 53 | protected var facade:IFacade = Facade.getInstance(); 54 | } 55 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/observer/Observer.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.observer 6 | { 7 | import org.puremvc.as3.interfaces.*; 8 | 9 | /** 10 | * A base IObserver implementation. 11 | * 12 | *

13 | * An Observer is an object that encapsulates information 14 | * about an interested object with a method that should 15 | * be called when a particular INotification is broadcast.

16 | * 17 | *

18 | * In PureMVC, the Observer class assumes these responsibilities: 19 | *

25 | * 26 | * @see org.puremvc.as3.core.view.View View 27 | * @see org.puremvc.as3.patterns.observer.Notification Notification 28 | */ 29 | public class Observer implements IObserver 30 | { 31 | private var notify:Function; 32 | private var context:Object; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | *

38 | * The notification method on the interested object should take 39 | * one parameter of type INotification

40 | * 41 | * @param notifyMethod the notification method of the interested object 42 | * @param notifyContext the notification context of the interested object 43 | */ 44 | public function Observer( notifyMethod:Function, notifyContext:Object ) 45 | { 46 | setNotifyMethod( notifyMethod ); 47 | setNotifyContext( notifyContext ); 48 | } 49 | 50 | /** 51 | * Set the notification method. 52 | * 53 | *

54 | * The notification method should take one parameter of type INotification.

55 | * 56 | * @param notifyMethod the notification (callback) method of the interested object. 57 | */ 58 | public function setNotifyMethod( notifyMethod:Function ):void 59 | { 60 | notify = notifyMethod; 61 | } 62 | 63 | /** 64 | * Set the notification context. 65 | * 66 | * @param notifyContext the notification context (this) of the interested object. 67 | */ 68 | public function setNotifyContext( notifyContext:Object ):void 69 | { 70 | context = notifyContext; 71 | } 72 | 73 | /** 74 | * Get the notification method. 75 | * 76 | * @return the notification (callback) method of the interested object. 77 | */ 78 | private function getNotifyMethod():Function 79 | { 80 | return notify; 81 | } 82 | 83 | /** 84 | * Get the notification context. 85 | * 86 | * @return the notification context (this) of the interested object. 87 | */ 88 | private function getNotifyContext():Object 89 | { 90 | return context; 91 | } 92 | 93 | /** 94 | * Notify the interested object. 95 | * 96 | * @param notification the INotification to pass to the interested object's notification method. 97 | */ 98 | public function notifyObserver( notification:INotification ):void 99 | { 100 | this.getNotifyMethod().apply(this.getNotifyContext(),[notification]); 101 | } 102 | 103 | /** 104 | * Compare an object to the notification context. 105 | * 106 | * @param object the object to compare 107 | * @return boolean indicating if the object and the notification context are the same 108 | */ 109 | public function compareNotifyContext( object:Object ):Boolean 110 | { 111 | return object === this.context; 112 | } 113 | } 114 | } -------------------------------------------------------------------------------- /src/org/puremvc/as3/patterns/proxy/Proxy.as: -------------------------------------------------------------------------------- 1 | /* 2 | PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License 4 | */ 5 | package org.puremvc.as3.patterns.proxy 6 | { 7 | import org.puremvc.as3.interfaces.*; 8 | import org.puremvc.as3.patterns.observer.*; 9 | import org.puremvc.as3.patterns.facade.Facade; 10 | 11 | /** 12 | * A base IProxy implementation. 13 | * 14 | *

15 | * In PureMVC, Proxy classes are used to manage parts of the 16 | * application's data model.

17 | * 18 | *

19 | * A Proxy might simply manage a reference to a local data object, 20 | * in which case interacting with it might involve setting and 21 | * getting of its data in synchronous fashion.

22 | * 23 | *

24 | * Proxy classes are also used to encapsulate the application's 25 | * interaction with remote services to save or retrieve data, in which case, 26 | * we adopt an asyncronous idiom; setting data (or calling a method) on the 27 | * Proxy and listening for a Notification to be sent 28 | * when the Proxy has retrieved the data from the service.

29 | * 30 | * @see org.puremvc.as3.core.model.Model Model 31 | */ 32 | public class Proxy extends Notifier implements IProxy, INotifier 33 | { 34 | 35 | public static var NAME:String = 'Proxy'; 36 | 37 | /** 38 | * Constructor 39 | */ 40 | public function Proxy( proxyName:String=null, data:Object=null ) 41 | { 42 | 43 | this.proxyName = (proxyName != null)?proxyName:NAME; 44 | if (data != null) setData(data); 45 | } 46 | 47 | /** 48 | * Get the proxy name 49 | */ 50 | public function getProxyName():String 51 | { 52 | return proxyName; 53 | } 54 | 55 | /** 56 | * Set the data object 57 | */ 58 | public function setData( data:Object ):void 59 | { 60 | this.data = data; 61 | } 62 | 63 | /** 64 | * Get the data object 65 | */ 66 | public function getData():Object 67 | { 68 | return data; 69 | } 70 | 71 | /** 72 | * Called by the Model when the Proxy is registered 73 | */ 74 | public function onRegister( ):void {} 75 | 76 | /** 77 | * Called by the Model when the Proxy is removed 78 | */ 79 | public function onRemove( ):void {} 80 | 81 | 82 | // the proxy name 83 | protected var proxyName:String; 84 | 85 | // the data object 86 | protected var data:Object; 87 | } 88 | } -------------------------------------------------------------------------------- /src/puremvc-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | --------------------------------------------------------------------------------