hjælp fra actionscript 1 til actionscript 2
Hej er der nogle der kan hjælpe, jeg er desværre ikke så stærk i actionscript 2 endnu, men jeg har en hele dele actionscript 1 kode som jeg gerne vil conventer til actionscript 2 kode. Er der nogle der ved om der findes et gratis program der kan det. Ellers er der nogle der kan hjælpe mig med at conventer dette kode stykke:function insertTag(Code, CodeOn, CodeOff) {
// selection?
if (/:SelectionEnd > /:SelectionStart) {
/:PlainText = /:PlainText.slice (0,/:SelectionStart) + CodeOn + /:PlainText.slice (/:SelectionStart,/:SelectionEnd) + CodeOff + /:PlainText.slice (/:SelectionEnd);
/:LastCursorPos = /:SelectionEnd + length (CodeOn) + length (CodeOff);
/:SelectionEnd = -1;
// no selection - code on / off
} else if (eval (Code)) {
eval (Code) = 0;
/:PlainText = /:PlainText.slice (0,/:LastCursorPos) + CodeOff + /:PlainText.slice (/:LastCursorPos);
/:LastCursorPos += length (CodeOff);
} else {
eval (Code) = 1;
/:PlainText = /:PlainText.slice (0,/:LastCursorPos) + CodeOn + /:PlainText.slice (/:LastCursorPos);
/:LastCursorPos += length(CodeOn);
}
}
// ----------------------------------------------------
function insertLink(LinkText) {
if (/:SelectionEnd > /:SelectionStart) {
/:PlainText = /:PlainText.slice (0,/:SelectionStart) + LinkText + /:PlainText.slice (/:SelectionStart,/:SelectionEnd) + CodeOff + /:PlainText.slice (/:SelectionEnd);
/:LastCursorPos = /:SelectionEnd + length (LinkText);
/:SelectionEnd = -1;
} else {
/:PlainText = /:PlainText.slice (0,/:LastCursorPos) + LinkText + /:PlainText.slice (/:LastCursorPos);
/:LastCursorPos += length (LinkText);
}
}
// ----------------------------------------------------
function selectText() {
Selection.setFocus("_level0.PlainText");
Selection.setSelection(length(/:PlainText),length(/:PlainText));
_root.setTop("TextBox");
