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]
1  Announcements and General Discussion / General Discussion / Re: Reusing components as subcomponents / dynamic mediators on: July 12, 2009, 11:42:29
Sorry for the inconvenience  :o
But now it should be working now, please have a look  ::)
So does that code looks good for you ?
2  Announcements and General Discussion / General Discussion / Re: Reusing components as subcomponents / dynamic mediators on: July 07, 2009, 12:22:55
Hello,
I know tis topic is quite old but I made a demo on my website and I'd like to see if this is correct ;-)

You can find the post at
http://blog.loadvars.com/2009/07/07/using-multiple-instances-of-the-same-mediator-in-puremvc/

Demo
http://files.loadvars.com/puremvc/multicore/multiplicity/

View source
http://files.loadvars.com/puremvc/multicore/multiplicity/srcview/index.html

Cliff, is my example correct ?
Feel free to use it and keep up the good work :)
3  PureMVC Manifold / Standard Version / Re: How to use Mediator with Flex's Repeater ? on: January 04, 2009, 11:56:30
I found a solution, I use the "Bubbling phase" of the MouseEvent and I add the listener to the container that hold the several button added by the repeater...
I had also to set mouseChildren to false on each <mx:Image>... If I didn't add "mouseChildren" sometime the target of the event would be an mx:Loader...

Cheers
4  PureMVC Manifold / Standard Version / How to use Mediator with Flex's Repeater ? on: December 31, 2008, 04:24:15
Hello,
I'm developing some kind of image gallery in Flex 3 + PureMVC and in one of my UI component, I use a repeater, I guess it is a kind of unusual case... Usually it is simply:

Mediator:
:
someId.addEventListener()...

View component:
:
[Bindable] public var images:ArrayCollection;

...

<mx:HBox id="thumbnailContainer" width="50%" horizontalCenter="true" horizontalAlign="center" styleName="thumbContainer" backgroundAlpha="0.2" backgroundColor="#433838">
    <mx:Repeater id="thumbRepeater" dataProvider="{images}">
    <mx:Image source="{String(thumbRepeater.currentItem.thumb)}"
maintainAspectRatio="true"
height="50" width="100%"
click="onChangeCurrentImage(event)"
styleName="selectedThumb" />
    </mx:Repeater>
</mx:HBox>

...

private function onChangeCurrentImage(event:MouseEvent):void //, item:Object):void
{
selectedTarget = event.currentTarget;
selectedItem = selectedTarget.getRepeaterItem();
dispatchEvent(new Event(EVENT_CHANGE_CURRENT_IMAGE));
}

And in the mediator:
:
ui.addEventListener( ItemImagesPanel.EVENT_CHANGE_CURRENT_IMAGE, onChangeCurrentImage);


It is the first time I use a repeater in an UI with PUREMVC Mediator and I'm not sure if I did it right !
I need to get the item data in order to change the image... I hope my post was understabe enough ;-)

Any advices, remarks ?

I guess I could make a custom event and add a "data" property on it...

Thanks!
Pages: [1]