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);
}
/************************************************************************************
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
Blank/White background
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.
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
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 .
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
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:
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
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?
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
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
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
Adding Next, Prev Function and Text Description with external images (jpg) or external SWF or internal movieClip to be combine with txeff or flasheff
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
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
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
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...
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
@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 .
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



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