Dodona gives you answers

Archive for the ‘Actionscript’ Category

How do I prevent a textfield in Actionscript from scrolling 1 line when it shouldn’t scroll?

without comments

There is a strange bug in Actionscript which makes a textfield which shouldn’t scroll still scroll one line. I only found this bug in Windows and only when scrolling using the scroll-wheel.
The code below, although not very beautiful, will prevent the textfield from scrolling. I found it here.

myTextField.addEventListener(Event.SCROLL, onScroll);

function onScroll(evt:Event):void {
    myTextField.scrollV = 0;
}


Link
: http://www.kirupa.com/forum/showthread.php?t=288955

Status: Tested it, works

Written by lutsen

September 12, 2008 at 11:28 am

Posted in Actionscript

How can I convert vector drawings to actionscript code?

without comments

This on-line tool extracts shapes from Flash .swf files and returns them in a format which can be rendered by actionscript. This way you can manipulate drawn vector graphics with actionscript.

Link: Quasimondo’s Actionscript Shape Decoder

Status: Tested it, works

Written by lutsen

August 28, 2008 at 9:37 pm

Posted in Actionscript

How do I find and replace a string in actionscript 2?

without comments

I use this findReplace function to replace a string in actionscript:


// (from http://proto.layer51.com/d.aspx?f=23)
var findReplace = function(searchStr:String, findStr:String, replaceStr:String) {
   var locationNum:Number = searchStr.indexOf(findStr, 0);
   while (locationNum != -1) {
      var sub1 = searchStr.substr(0, locationNum);
      locationNum += findStr.length;
      var sub2 = searchStr.substr(locationNum, searchStr.length);
      var searchStr = sub1 + replaceStr + sub2;
      var locationNum = searchStr.indexOf(findStr, sub1.length);
   }
   return(searchStr);
}

Status: tested it, like it

Link: I found this function here

Written by lutsen

August 19, 2008 at 11:37 am

Posted in Actionscript, Web