This text is replaced by the Flash movie.

Archive for the ‘Flash’ Category

Transition Between 2 Movie Clips with Tween Class

February 18th, 2011
This is just Basic Flash ActionScripting with 2.0 Using TweenClass Between 2 movieClips. In this example I used 2 images which converted to were movie clip, which I will make first Movie Clip to appear first by transitioning from alpha 0 to 100 then transisioning back from 100 to 0 and then calling Movie Clip 2 to do the same transition then loop back to Movie Clip 1 to repeat the transition.

First Have your first movie clip then convert it - name it anything you want.

Converting to a movie Clip

The important part is assigning the instance name of the movie clip, this is the ActionScript name going to identify. For this example I name firt movie clip as movP1 and second movie clipt as movP2.

Instance naming movie Clip

so put this as2 script inside a frame (where the movies are also visible)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import mx.transitions.Tween;
import mx.transitions.easing.*;
 
movP1._alpha = 0;
movP2._alpha = 0;
 
firstTween();
 
function firstTween(){
var Tween1:Tween = new Tween(movP1, "_alpha", Strong.easeOut, 0, 100, 5, true);
setTimeout(doNextTween, 5000);
 
}
 
function doNextTween(){
  var Tween2:Tween = new Tween(movP1, "_alpha", Strong.easeOut, 100, 0, 5, true);
  var Tween3:Tween = new Tween(movP2, "_alpha", Strong.easeOut, 0, 100, 5, true);
  setTimeout(loopBack, 5000);
 
}
 
function loopBack(){
  var Tween4:Tween = new Tween(movP2, "_alpha", Strong.easeOut, 100, 0, 5, true);
  setTimeout(firstTween, 100);
}


setTimeout(doNextTween, 5000);
this call the function after 5 seconds.

Demo:
Flash required


Or Just
Download The Source File.

Flex Compare Validator

December 7th, 2010
Looking for Flex Compare Field Validator?

Well these custom classes could help you.

A Simple Form Field Comparison Validator for Flex
Flex CompareValidator custom Validator



Flash required


You can download the sample code here along with the Package classes.

Premiere CS4 Export Video Problem

June 12th, 2010

Premiere CS4 Flash Catalyst CS5 After Editing a video using Premiere CS4 , and try exporting the sequence I have - Adobe Media encoder pops out, and for some reason I couldn't find the sequence I was just trying to export. After few hours figuring out why - I noticed that the version on Media Encoder popping out is CS5. This Encoder came with Flash Catalyst cause I'm trying their Demo Version - which is very promising for Designers to be able to communicate and explain well to the Developers on how they want the site should function.

So what I did was just uninstall the Flash Catalyst since I was done of studying it anyway. And Everything worked fine, when I tried to export the Sequence I have on Premiere CS4 its popping out Media Encoder CS4 and finally I can see the sequence on the list.

Flash AS3 and Mootools Slimbox

February 26th, 2010
Most the site I made were based on mootools library but when it comes to Overlay Images Scripts I prefer to use Light box v2 that also you can easily call with in Flash AS3 using the ExternalInterface.call using a bridge which is available for download - flashlightboxinjector unfortunately this is base on jQuery library so I tried to find a "Lightbox" similar Overlay Image function that has available javascript that I can call within Flash AS3 code so Slimbox I guess the easiest for me to follow, it got API documentation you can follow http://code.google.com/p/slimbox/wiki/MooToolsAPI.
So this is the code inside the flash movie
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//Begin AS3 Script
  import flash.geom.*
  import flash.display.*
 
//Mouse Events  
  import  flash.events.MouseEvent;
//External Command
  import flash.external.*;
 
//gradient background color  
  var fillType:String = GradientType.LINEAR;
  var colors:Array = [0x330000, 0x333307];
  var alphas:Array = [1, 1];
  var ratios:Array = [0x00, 0xFF];
  var matr:Matrix = new Matrix();
  matr.createGradientBox(150, 20, 0, 0, 0);
  var spreadMethod:String = SpreadMethod.PAD;
  this.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);  
  this.graphics.drawRect(0,0,250,200);
//gradient background color  
 
//Add handler Event
  img1.addEventListener(MouseEvent.CLICK, onClickHandler01);
 
 
 
function onClickHandler01(myEvent:MouseEvent){
    //call	Javascript Command
	ExternalInterface.call("Slimbox.open","/images/demon.png", "This Kanji means Demon");
 
}		
 
//End AS3 Script
ExternalInterface.call("Slimbox.open","/images/demon.png", "This Kanji means Demon");
This simply calls the javascript Slimbox.open function that will open an Overlay Image also make sure that parameters that "wmode" = "transparent" and "allowScriptAccess" = "always"
I used swfobject to render my Flash movies. So here how you implement the html code to make the flash work with slimbox.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    <!-- Slimbox Start //-->
    <script type="text/javascript" src="js/swfobject.js"></script>
    <script type="text/javascript" src="js/mootools.js"></script>
    <script type="text/javascript" src="js/slimbox.js"></script>
    <link rel="stylesheet" href="css/slimbox.css" type="text/css" media="screen" />
    <!-- Slimbox End //-->
 
 
               <script type="text/javascript">
                             window.addEvent('domready', function(){ //for IE 7 problem
			var soSlim = new SWFObject("slimbox.swf", "slimbox", "250", "200", "8", "#FFFFFF");
			soSlim.addParam("quality", "high");
			soSlim.addParam("wmode", "transparent");
			soSlim.addParam("allowScriptAccess", "always");
			soSlim.write("flashcontentSlim");
                            });   
		</script>
Demo:
Flash required


You can also try milkbox

Download Source Code.