������: ������ � �������������
� ���� ������� �� �������� ����������, ������� ���������� � ������������
��� ���, ���������� � ���������� ��� ��� ����������� �������� ����������.
��� ���� ����� ��������� ������, ��������� �������������, �� �������������
������������ ������������� FSCommand.
��������� ��������� ��������, ����� ������� ����������, ������� ����������
� ���������� ��� ������������:
- �������� SWF Maestro (EXE).
- ������� ������ ��...� � �������� ���� �� ��������� ������,
��������� � ���������� ��������.
- �������� ������ > ����� ��� ����������.
- �������� �������������� ���� SWF ���� � ������� ���� � ����� �dialog.swf�
� �Tutorials\Interaction� ����������. �� ���������� �FSCommand� � ������
��� ������ � ���������� ������, ����� ���������/������������ ���, ���������
�������������.
- ������� ���������� ���...�, ����� ��������� ������.
- ������� "������������", ����� �������������� ����������.
FLA-���� ����������, �� �������� ��� ������ �interaction.swf� �� �������
� ���������� 'Tutorials\FLAs'.
�������� interaction.swf:
������� �� 3� ������.
1� ���� �������� ActionScript:
stop();
var UserName="";
function watchCallback (id, oldval, newval) {
� if(newval=="") {
����������� gotoAndStop(2);
� } else {
����������� gotoAndStop(3);
� }
};
_root.watch("UserName", watchCallback);
fscommand("storage.get","UName,UserName");
�����������:
stop();
������������� ���������������, ����� ���������������� ���������� � ���������:
�������� �� ��� ��� ������������.
var UserName="";
�������������� ����������, � ������� ����� ������ ��� ������������.
function watchCallback (id, oldval, newval)
��� ������� ����� ��������� ����� ����� ��������� ������ �� ���������
������. ��� ����������� ���������� �������� ������ � ��������� � 2��
�����, ���� ��� �� ��������, ����� � ��������� � 3�� �����.
_root.watch("UserName", watchCallback);
���� ������� watch-������� �� ������������ ������������� ���������� UserName.
����� ���������� ������� ��������, ���������� ����� ����� watchCallback-�������.
fscommand("storage.get","UName,UserName");
���� ������� �� ������ �������� UName �� ��������� �������� � �����������
��� ���������� UserName.
����������. �� �� ����� ������ ��������� �������� � ������� FSCommand(�storage.get�,��) � ������� � ������� �����, �.�. FSCommand - ������� ����������� � ���������� ���������� ����������, �� ������������ ��������� ��������. ������� ��������� ������� ���������������� �������, ������� ����������� ����� ��������� ��������.
2� ���� ��������: �Input Text�-���� ��� ��������� �InputName� � �PushButton�, � �������� �Click Handler = onConfirm�.
2� ���� ����� �������� ActionScript:
function onConfirm(component){
����������� FSCommand("storage.set","UName,"+InputName.text);
����������� gotoAndStop(1);
}
�����������:
��� ������� ����������� ��� ������� ������ � �������� ��������� ������������� ����� (���) � ��������� ������ ��� �������� � ��������� �UName�.
3� ���� ��������: �Dynamic Text�-���� ��� ��������� �DynaText� � �PushButton�, � �������� �Click Handler = onReset�.
3� ���� ����� �������� ActionScript:
function onReset(component){
����������� FSCommand("storage.clear");
����������� gotoAndStop(1);
}
function watchCallback (id, oldval, newval) {
� if(newval=="") {
����������� gotoAndStop(2);
� } else {
����������� DynaText.text="������, "+newval;
� }
};
_root.watch("UserName", watchCallback);
fscommand("storage.get","UName,UserName");
�����������:
function onReset(component) { }
��� ������� ����������� ��� �������
������ � ������� ��������� ������. ��������� ��� ������ UName-�������� �� ���������
������ �, ���� �������� ������, �� ��������� ���������� 2�� �����,
����� �������� � ��������� ���� ������ �����������. |