Skew Text in flash

Skew Text Using Flash Action Script

Step-1 Open a new document in flash.

Step-2 Writes the following script in Key frame 1 – action script panel (F9).

inputString = “Skew Text”;
letterWidths = new Array(0, 55, 35, 20, 40, 40, 40, 50, 40, 40, 20, 40, 35);
offset = 65;
for (count = 0; count < inputString.length; count++)
{
    attachMovie(“skewtext”, “letter” + count, count);
    thisLetter = this[“letter” + count];
    offset = offset + letterWidths[count];
    thisLetter._x = offset;
    thisLetter._y = 150;
    thisLetter.topLetter.midLetter.rawLetter.text = inputString.charAt(count);
    storeHeight = thisLetter._height;
    storeWidth = thisLetter._width;
    thisLetter.letterWidth = letterWidths[count + 1];
    thisLetter.skewAxis = 1;
} // end of for
mouseListener = new Object();
Mouse.addListener(mouseListener);
_root.skewMeX = function (skewTarget, degrees)
{
    var _loc1 = skewTarget;
    skewAmt = 1 / Math.tan(0.017453 * degrees / -2);
    _loc1.topLetter.midLetter._rotation = 45 * skewAmt / skewAmt;
    _loc1.topLetter._xscale = skewAmt * 100;
    _loc1.topLetter._rotation = -1 * skewAmt / skewAmt * Math.atan(1 / skewAmt) * 180 / 3.141593;
    newHeight = Math.sin(-2 * Math.atan(1 / skewAmt)) * storeHeight * -1;
    _loc1._xscale = 100;
    _loc1._yscale = 100;
    newScale = 100 * newHeight / _loc1._height;
    _loc1._xscale = newScale;
    _loc1._yscale = newScale;
};

Step-3 Here I had set background image by importing (Ctr l + Enter) into stage.

Step-4  Ctrl + Enter to run the program.

Final Preview:

Tags: , , ,

Request a Free SEO Quote