"use strict";
cc._RF.push(module, '0a3a4ttcyZN1qgDZtEw5sHa', 'A');
// Script/A.ts

// Learn TypeScript:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = 'hello';
        _this._audioSource = null;
        // LIFE-CYCLE CALLBACKS:
        _this._musicId = -1;
        return _this;
    }
    NewClass.prototype.onLoad = function () {
    };
    NewClass.prototype.start = function () {
        var _this = this;
        // this._audioSource = this.node.getComponent(cc.AudioSource)
        // this._audioSource.volume = 0.5
        cc.loader.loadRes('lobbyBg', cc.AudioClip, function (err, sound) {
            if (err) {
                console.log('err');
                return;
            }
            cc.audioEngine.stopAll();
            _this._musicId = cc.audioEngine.playMusic(sound, true);
        });
    };
    NewClass.prototype.onDestroy = function () {
        cc.audioEngine.stop(this._musicId);
    };
    NewClass.prototype.sliderCall = function (target) {
        console.log(target.progress);
        // this._audioSource.volume = target.progress
        // cc.audioEngine.setMusicVolume(target.progress)
        cc.audioEngine.setVolume(this._musicId, target.progress);
    };
    NewClass.prototype.clickToMain = function () {
        cc.director.loadScene('helloworld');
    };
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "label", void 0);
    __decorate([
        property
    ], NewClass.prototype, "text", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();