I would tell you this would be the perfect case to move away from the
timeline instead of managing frames, but that's a whole other huge
discussion on OOP development in AS3.  But something to consider if  you
are up for it.


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac
Alves
Sent: Thursday, August 06, 2009 11:20 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] manage conent of multiple frames with a
singleframescript

I would lke to know if I can manage the content of multiple frames
without
having to create a script for each frame.

project:
This is part of a type of "powerpoint style" presentation in flash.
another
time I'll certainly try to do it by loading everything in the XML, and
no
frame Nav. then the listener should not only tween the textfields and
movieclips, but also get the values of these objects by xml.

a mouse click calls a function that fades out a textfield in a frame, go
to
another frame and fades in the textfield that is in that frame.

 Code:

function changeFrame(e):void
{
        if (_txt){
                new GTween(_txt, 0.3 ,{alpha:0});
        }
        var timer:Timer = new Timer(300, 1);
        timer.addEventListener(TimerEvent.TIMER, function(){
                e.target.addEventListener(Event.ENTER_FRAME,
updateFrame);
                gotoAndStop(e.target.frameLink);
                                                                   });
        timer.start();
}

function updateFrame(e:Event):void
{

        if (_txt){
                _txt.alpha =0;
                new GTween(_txt, fadeDuration ,{alpha:1});

        }

        e.target.removeEventListener(Event.ENTER_FRAME, updateFrame);
        timer.reset();
}

problem:
when it changes frame, the actual movieclip or textfield will be there
with
alpha 1. so it blinks, between the two alpha animations.

conditions:
the fade should function with many movieclips, some of which won't exist
in
every frame, that's why the verification ( if (!_txt)... ) But for the
moment I'm doing it like this.

I surely don't want to write scripts in every frame, so that's the
reason I
wrote the code like this.

And anyway, I somehow feel that I shouldn't do it that way. What do you
people think about it ?

Thanks in advance !
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to