Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: 1 ... 3 4 [5]
61  PureMVC Manifold / Multicore Version / Extending/Inheriting using puremvc.define on: April 07, 2012, 08:47:08
a.js

puremvc.define(
{
    name: 'view.component.a',
   
    constructor: function(){
        alert('inside component a');
    }
}
);

b.js

puremvc.define(
{
    name: 'view.component.b',
    parent: view.component.a,
   
    constructor: function(){
        alert('inside constructor b');
    }
}
);

inside html (as a test)
        <script>
            //var a = new view.component.a();
            var b = new view.component.b();
        </script>

I'm trying to have the super constructor called while instantiating b, please advise. do we access to super something?
62  PureMVC Manifold / Standard Version / Re: Inacessible method through a static type reference on: January 25, 2011, 03:40:37
Hi Cliff:

You are right, it's some kind of ActionScript error but really a weird one, the import is right as it works with the first statement but fails on the second attempt, and only work around is to call the function through viewComponent without using the get method.

I have uploaded the project for you to have a look at http://www.filefactory.com/file/b524h9b/n/DragRace.zip

It's a small project at this stage, nothing complex, just a StartupCommand with mediator initializations and a notification, kindly have a look.

My working environment is Flash CS5/Flash Builder 4
63  PureMVC Manifold / Standard Version / Inacessible method through a static type reference on: January 24, 2011, 07:27:11
Inside DragRaceMediator.as (it's basically my stageMediator or applicationMediator)

      override public function handleNotification(notification:INotification):void {
         switch(notification.getName()){
            case ApplicationFacade.SHOW_MENU:
               dragRace.showMenu(); //works fine here
               //viewComponent.showModal(); //works fine, method exists and gets called
               dragRace.showModal(); //throws inaccessible method error,
               break;
            
            default:
               break;
         }
      }

      
      private function get dragRace():DragRace {
         return viewComponent as DragRace;
      }


Inside DragRace.as (which is actually my main document file)

   public class DragRace extends MovieClip {

      private var _menu:Menu;   
      private var _modal:Modal;

      public function DragRace() {
         
         menu = new Menu();
         modal = new Modal();
         
         ApplicationFacade.getInstance().startup(this);
      }
      
      public function showMenu():void {
         addChild(menu);
         trace('show menu');
      }
      
      public function hideMenu():void {
         removeChild(menu);
      }
      
      public function showModal():void {
         trace('show modal');
         addChild(modal);
      }
      
      public function hideModal():void {
         removeChild(modal);
      }

      public function get menu():Menu {
         return _menu;
      }

      public function set menu(value:Menu):void {
         _menu = value;
      }

      public function get modal():Modal {
         return _modal;
      }

      public function set modal(value:Modal):void {
         _modal = value;
      }
         }
64  PureMVC Manifold / Standard Version / Re: Using multiple instances of the same Mediator on: January 10, 2011, 04:43:59
Hi:

I worked it out using following strategy,

@implementation CigaretteMediator

+ (NSString *)NAME {
    return @"CigaretteMediator";
}

- (void)initializeMediator {
    self.mediatorName = [[CigaretteMediator NAME] stringByAppendingString:[viewComponent name]];
}

in my view component had to create a function and property ([viewComponent name]), for setting and retrieving a unique name, though I was looking for a built-in property such as what Cliff suggest like id something, is there something like that we can set and get a built-in property programmatically for each UIViewController
65  PureMVC Manifold / Standard Version / Using multiple instances of the same Mediator on: December 28, 2010, 05:57:10
http://blog.loadvars.com/2009/07/07/using-multiple-instances-of-the-same-mediator-in-puremvc/

In view of the above post, how to accomplish the same for Objective-C Port?
Pages: 1 ... 3 4 [5]