Skip to main content
RUSH-ME
Participant
September 3, 2010
Question

Cairngorm 3 confusion

  • September 3, 2010
  • 1 reply
  • 597 views

Hello folks

I am trying to implement a simple flex application using Cairngorm 3, Parsley 2.3.0 and flex 4.1.

I have a confusion about how to separate logic from design which is Cairngorm 3's motto.

Here is the sample code from one of my presentation model which deals with logic.

private function displayImage(image:Image):void

            {

                image.alpha = 0;

              imageContainer.addChild(image);

                this.loadedImages.push(image);

                TweenLite.to(preloader, 1, {alpha:0, onComplete:removeOldImage});

                TweenLite.to(image, 1, {alpha:1, onComplete:removePreload});               

            }

In the above code red colored ids are from My mxml component. which I could not get in the Presentation model.

Is there any way to achieve this without breaking cairngorm 3 rules.

Any suggestions will be appreciated.

With Warm Regards

Rush-me

This topic has been closed for replies.

1 reply

Participating Frequently
September 13, 2010

You could define this declarativley with states and transitions, which might make it a bit easier to read. When using transitions you might not be able to use TweenLite, though but would use the Flex effects framework.

BTW: in case you're using the C3 libraries, we've released the ones compatible for Parsley 2.3 here.