Knowledge Base


Important! All new questions are usually answered within the next business day.

MCTE V3 (MovieClip Transition Effect V3)

(views: 20036)

A transition effect component with lots lots of flash animation effects already included and lots of patterns sold separately. Here are all known common issues for MCTE V3, the custom patterns are treated here too. If you have any questions that you think we should discuss here please let us know. Write to support.



Multiple transitions using ActionScript code

(2009-01-06 - views: 3013)

Q: How can I use MCTE to to show and hide sequential images with transitions using code ?
A: Here is the AS3 code for doing it. You can use the same images as the AS2 example and drag the AS3 MCTE component from the Components panel into the Library.

/************************************************************************************

Please note that all the image movie clips have linkage ids set, so they can be
attached to the Stage via ActionScript code.

************************************************************************************/
import com.jumpeye.Events.MCTEEvents;

var intervalID:Number;
// The list of patterns that will be used, each one on a single image.
var patternList:Array = new Array("Waves", "SquareScale", "Stripes", "AlphaBars");
// The list of images attached from the Library.
var imageList:Array = new Array("Image1", "Image2", "Image3", "Image4");
// The index of the current image and the current pattern.
var index:int = -1;
// The target movie clip into which the images will be loaded from the Library. The
// The transitions will be applied on this target clip.
var target_mc:MovieClip = new MovieClip();
target_mc.x = 25;
target_mc.y = 25;
target_mc.name = "target_mc";
this.addChild(target_mc);

// Create the MCTE component instance.
var mcteTransitions:MCTE = new MCTE();
this.addChild(mcteTransitions);
// Initialize the transition type to hide, so when the startNewTransition
// function will initialy be called, the function will enter in the
// first "if" branch and attach the first image.
mcteTransitions.transitionType = "hide";
mcteTransitions.addEventListener(MCTEEvents.TRANSITION_END, transitionEndHandler);

// Each time a show or hide transition ends, the startNewTransition
// function will be called after 1 second.
function transitionEndHandler(evtObj:MCTEEvents):void {
    var timerObj:Timer = new Timer(1000, 1);
    timerObj.addEventListener(TimerEvent.TIMER, startNewTransition);
    timerObj.start();
}

// The initial call of the function - this initiates the first transition
// (the "show" transition of the first image in the list).
startNewTransition(null);

// This functions attaches each image when it is the case, sets up the
// MCTE component instance and executes the transition.
function startNewTransition(evtObj:TimerEvent):void {
    //clearInterval(intervalID);
    // If the previous transition was a "hide" transition, then the next
    // one should be a "show" transition.
    if (mcteTransitions.transitionType == "hide") {
        // Remove the previous image clip on which the transitions were
        // applied.
        if (target_mc.numChildren > 0) target_mc.removeChildAt(0);
        mcteTransitions._targetInstanceName = "";
        // Attach the next clip for the transition and set the next
        // pattern for MCTE.
        index++;
        if (index > 3) index = 0;
        var ImageName:Object = getDefinitionByName(imageList[index]);
        var img:DisplayObject = new ImageName();
        target_mc.addChild(img);
        trace(index+" - "+imageList[index]);
        mcteTransitions.transitionType = "show";
        mcteTransitions.patternName = patternList[index];
        mcteTransitions._targetInstanceName = target_mc.name;
    }
    else {
        mcteTransitions.transitionType = "hide";
    }
    mcteTransitions.autoPlay = false;
    mcteTransitions.preset = 1;
    trace(mcteTransitions.patternName+" :: "+mcteTransitions.transitionType);
    
    // Set the gain and tween duration for each of the patterns.
    switch(mcteTransitions.patternName) {
       
        case "Waves": {
            mcteTransitions.gain = 50;
            mcteTransitions.tweenDuration = 20;
        }break;
       
        case "SquareScale": {
            mcteTransitions.gain = 50;
            mcteTransitions.tweenDuration = 20;
        }break;
       
        case "Stripes": {
            mcteTransitions.gain = 25;
            mcteTransitions.tweenDuration = 15;
        }break;
       
        case "AlphaBars": {
            mcteTransitions.gain = 25;
            mcteTransitions.tweenDuration = 50;
            // In case of "AlphaBars" preset 8 will be used to show the image
            // and preset 7 to hide it.
            if (mcteTransitions.transitionType == "show") mcteTransitions.preset = 8;
            else mcteTransitions.preset = 7;
        }break;
    }
    // Execute the show/hide transition.
    mcteTransitions.transitionEffect(mcteTransitions.transitionType);
}


User Comments

Thank you
posted by ignacio on 2009-01-06

Thank you guys, really appreciate.
Would it be too much to ask for a AS3 code where the images transition into each other, without the blank between them?

b/rgds

Ignacio
Blank/White background
posted by dzzx on 2009-02-14

Hi, I would like to ask if there's any way of removing the blank/white background between the transitions, possibly without using MTCE Loader?
Thanks.
Blank/White background
posted by florodebat on 2009-02-17

Hello,

You can not remove that white background between the transition because that is the color of the stage. All you can do is to change the color of the stage (select the stage, open the properties panel and then choose a new color .) or you can make your own background and place it on a new layer and it will be displayed under the images .
Custom Patterns
posted by TrailRunnr on 2009-04-02

Thanks for this AS3 script. I have been able to tweak it a little. I have increased the number of images and modified some of the defaults with presets. However, I have not been able to figure out how to incorporate the custom patterns.

Also, should all of the Built in Patterns work similar to the code above. I have had trouble with the slide and scale.

Any help will be appreciated. I am learning AS3 so please be gentle. (c:
Blank/White background
posted by AngeloPellegrinon on 2009-07-12

Hello,
sorry form my English.
Isn't it possibile to transform one foto into other?
Maybe using 2 MovieClips?
My problem is: I have an array of images, how can they tarnsorm each other naturally?
write to support
posted by florodebat on 2009-07-13

Hi,

Please open a new support ticket and write there a detailed description of what you are trying to achieve and shortly you will get an answer. Click the link bellow in order to open a new support ticket. Thank you.

http://www.jumpeyecomponents.com/support/open.php

Adding Button Function
posted by zulian on 2009-09-11

Adding Next, Prev Function and Text Description with external images (jpg) or external SWF or internal movieClip to be combine with txeff or flasheff
Adding Button Function
posted by florodebat on 2009-09-11

zulian,

I am not very sure about what certain is your question but you could try to open a new support ticket and ask there about that and I am sure you will get a quick answer.

http://www.jumpeyecomponents.com/support/open.php
error message
posted by xFLASHSTUDENTx on 2009-09-20

I'm getting this error message when I use the code above:

ArgumentError: Error #1063: Argument count mismatch on Image1(). Expected 2, got 0.
at Koders_test_fla::MainTimeline/startNewTransition()
at Koders_test_fla::MainTimeline/frame1()


I pasted the code, yet I'm getting that error message. Any suggestions? Thank you...

open a support ticket
posted by florodebat on 2009-09-23

@xFLASHSTUDENTx

Please open a support ticket and attach there your source files in order to get a quick answer to your problem. Thank you for your understanding .


Login to post your comment login to post your comment



Back

Knowledge Base Search

Enter keywords below:
Advanced Search
FlashEff 2.0
Create professional flash photo slideshows online

FREE Flash Stuff

Check out these free, fully functional AS3.0 Flash components by Jumpeye:

FlashEff 2.0 Free
(free for non-commercial use)

JC Panorama
(free for non-commercial use)

JC Play List
(fully free)

Basic Menu Pack V3
(free AS3 version)

MCTE V3
(free AS3 version)

JC Player
(free for non-commercial use)

JC Flash Map
(free for non-commercial use)

Flash Bookmarks
(fully free)

ActionScript Bridge AS2-AS3
(fully free)

JS Charts
(free for non-commercial use)

Free Trial Versions

The trial versions do have a major limitation. They will ONLY run into debugger flash player versions, such as the Flash IDE player and the activeX FP used by developers.

Switch from Free Trial version to Full version.

You can switch from Trial to Full versions in a blink of an eye.
See this tutorial in order to find out how.

We accept Google Checkout

Google Checkout Acceptance Mark

Secured by VeriSign