If you use a standart timeline animation with a shape tween above a button and you want to call a function that sets the events for the button from a frame - put the call to the function after the shape tween is over. If the shape tween is over the button, the shape receives the Mouse events and the button won’t work.

  • Share/Save/Bookmark

Comments No Comments »

Skinning Slider Component

In a comment on my previous post [AS3] Skinning Flash Components I was asked to show how to change the size of the thumb of the Slider component. After some experiments with the component here is the way it can be done:

import fl.controls.Slider;
 
var s:Slider = new Slider();
s.move(10,10);
s.setSize(500,300);
/*s.setStyle("thumbUpSkin", SliderThumbCustomSkin);
s.setStyle("thumbDownSkin", SliderThumbCustomSkin);
s.setStyle("thumbOverSkin", SliderThumbCustomSkin);*/
s.maximum = 100;
s.minimum = 0;
s.tickInterval = 5;
addChild(s);
s.getChildAt(1).width = 50;
s.getChildAt(1).height = 100;

With the code above I found that Read the rest of this entry »

  • Share/Save/Bookmark

Comments No Comments »

Using PNG in a MovieClip with Blend mode set to Overlay causes strange artifacts in Flash player 10

As you can see in the flash demo below, in Flash player 10 the  left image has strange artifacts while in the right image there are no artifacts.

I used Alpha: 99% for the Movie clip with the PNG and the artifacts were gone. I’m not sure what causes the artifacts in FP10 and if this solution is the right one, but it worked for me.

Here is the demo flash: Read the rest of this entry »

  • Share/Save/Bookmark

Comments No Comments »

Recently I was asked if I know how to show a number with a fixed number of digits after the decimal point. Here is how it can be done:

var num:Number = 12.3456;
trace(num.toFixed(2));// => 12.34

ATTENTION: This method toFixed returns String. If you want to have a Number after using this method you should use casting or:

var num:Number = 12.3456;
var num2:Number = Number(num.toFixed(2));
// => returns Number not String
  • Share/Save/Bookmark

Comments No Comments »

Today I run into this strange problem while trying to scale a Sprite containing dynamic TextField. As you can see in the flash demo below, when you scale the Sprite the TextField retains its position in the Sprite container.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

This is the code that I use for scaling: Read the rest of this entry »

  • Share/Save/Bookmark

Comments 2 Comments »

You can easily skin a Flash component using only ActionScript using component’s method setStyle() providing as parameters:

  1. the name of the style and
  2. your class that you want to use as the skin.

Here is the list of the styles that can be used for skinning a component:
Read the rest of this entry »

  • Share/Save/Bookmark

Comments 2 Comments »

After searching and trying a lot of different URLs for the Subversion repository of SWFAddress I finally found the right URL for my Tortoise SVN client. The address is:

https://swfaddress.svn.sourceforge.net/svnroot/swfaddress

  • Share/Save/Bookmark

Comments No Comments »

List of some useful ActionScript code snippets:

How to toggle button with two states in two lines of code,i.e. sound on/off button?

Let’s say you have a movieclip called “sound_btn” with two frames for the two states - sound on and sound off. Here is the code:

sound_btn.onRelease = function(){
 
this.gotoAndStop(Number(soundIsOn)+1);
 
soundIsOn = !soundIsOn;
 
}

The code soundIsOn = !soundIsOn; is equal to: Read the rest of this entry »

  • Share/Save/Bookmark

Comments No Comments »

This is the answer I got to my e-mail from Adobe:

Hello,
…..
Unfortunately there is a bug filed against the use of the stopAllSounds()and the FLVPlayback component. The stopAllSounds method breaks the play/pause button in FLVPlayback component.

The bug is currently deferred, so I can’t give you a potential fix date for this.

Regards,
Chris Bedford

Chris Bedford | Sr. Technical Writer | Adobe Systems

But I found a workaround using instanceof and checking if the object is instanceof Sound or instanceof FLVPlayback and then I call the Sound object’s stop() or the FLVPlayback component’s stop().

This is not very professional solution, but when I found a better one I’ll post it here.

BG version —————— Read the rest of this entry »

  • Share/Save/Bookmark

Comments No Comments »

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Отвори Транслитератор от кирилица на латиница

Това е първи опит за създаване на програмка за превръщане на текст изписан на кирилица в текст на латиница. Има още какво да се желае. Това все пак е първа версия. Има наченки за ползване на Ctrl+C и Ctrl+V за копиране.

  • Share/Save/Bookmark

Comments No Comments »

TxEff - The Flash Text Effects