Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Как добавить текст (http://www.flasher.ru/forum/showthread.php?t=128178)

getelse 04.08.2009 01:54

Код кнопки сохранения
Код AS1/AS2:

on(release) {
        loadVariables("target.php", "_root", "POST");
}

target.php
PHP код:

<?php
$f 
fopen("result.html""w");
fwrite($f'myText='stripslashes ($myText));
fclose($f);
?>

Код кнопки изменения (заключение фрагмента текста в скобки)
Код AS1/AS2:

txt.onSetFocus = txt_onSetFocusHandler;
txt.onKillFocus = txt_onKillFocusHandler;
 
mc.onRelease = mc_onReleaseHandler;
 
var beginIndex:Number;
var endIndex:Number;
 
function txt_onSetFocusHandler(oldFocus:Object):Void
{
        onMouseUp = onMouseUpHandler;
}
 
function txt_onKillFocusHandler(newFocus:Object):Void
{
        delete onMouseUp;
}
 
function onMouseUpHandler():Void
{
        beginIndex = Selection.getBeginIndex();
        endIndex = Selection.getEndIndex();
}
 
 
function mc_onReleaseHandler():Void
{
        if (beginIndex == endIndex)
                return;
 
        var newString:String = '(' + txt.text.substring(beginIndex, endIndex) + ')';
        txt.replaceText(beginIndex, endIndex, newString);
 
        delete beginIndex;
        delete endIndex;
}

В процессе перехода с одной кнопки на др. кнопку, изменения в тексте (которые дала
первая кнопка) не сохраняются, второй кнопкой.?

Xero201 04.08.2009 22:14

Смотри как все просто:
Код кнопки сохранения
Код AS1/AS2:

on(release) {
php_send = new LoadVars();
php_send.txt = txt.text;
php_send.sendAndLoad("http://site/target.php", php_send, "POST");
}

target.php
Код:

<?php
$myText = $_POST['txt'];
$f = fopen("result.html", "w");
fwrite($f, 'myText='.$myText);
fclose($f);
?>

А не та лабуда, которую ты взял с первой попавшейся ссылки "передача данных из Flash в PHP")))


Часовой пояс GMT +4, время: 10:02.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.