![]() |
|
||||||||||
|
|||||
|
Регистрация: Jul 2001
Адрес: piter
Сообщений: 56
|
проблема в след. в AS2 была изумительной простоты тега-
вопрос в том как тоже самое написать на AS3 необходимо отгрузить все звуки при нажатии на кнопку. вот имеется файлик управления кнопками((mapButton.as)) в нем пишу:
package com.UI {
import flash.display.MovieClip;
import utils.oldButtons;
import com.viewPort;
import com.core;
import com.UI.regionButton;
public class mapButton extends oldButtons {
private static var _instance:mapButton;
private var _selected:Boolean = false;
private var _regionBtn:regionButton;
public function mapButton() {
if (_instance) throw new Error("**Error** - singleton. Сonstructor is locked. Use instance");
_instance = this;
_regionBtn = this.getChildByName("region_btn") as regionButton;
setActions();
}
static public function get instance():mapButton {
return _instance;
}
private function setActions():void {
this.buttonMode = true;
_onRollOver = function():void {
if (!_selected)
this.gotoAndPlay(ON_ROLL_OVER);
}
_onRollOut = _onReleaseOutside = function():void {
if (!_selected)
this.gotoAndPlay(ON_ROLL_OUT);
}
_onRelease = function():void {
if (!_selected){
_selected = true;
if (this.getChildByName("region_btn"))
this.getChildByName("region_btn").visible = true;
viewPort.instance.mapView(core.instance.mapsArray, core.instance.panoramasArray);
}
}
}
public function reset():void {
if (_selected){
_selected = false;
this.getChildByName("region_btn").visible = false;
_onRollOut();
}
}
}
}
Последний раз редактировалось fin; 28.07.2008 в 12:14. |
![]() |
Часовой пояс GMT +4, время: 13:30. |
|
|
« Предыдущая тема | Следующая тема » |
|
|