Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (ti.ui.currentwindow)
Viewing all articles
Browse latest Browse all 3

"undefined" Errors with closing window

0
0

I'm getting "undefined" error messages for this few days when I tried to close window from the child window which opened from index.js. Could anybody tell me which part is making trouble.

Thank you.

index.js

$.openButton.addEventListener('click', function(){
    var ch_win = Alloy.createController('ch_win').getView();
    var win = Ti.UI.createWindow();
    win.left = Alloy.Globals.displayWidth;
    win.add(ch_win);
    var animation = Ti.UI.createAnimation({
        curve: Ti.UI.ANIMATION_CURVE_LINEAR ,
        });
    animation.left = 0;
    animation.duration = 500;
    win.open(animation);
});

ch_win.js

$.closeButton.addEventListener('click',function(){
    Ti.UI.currentWindow.close();
});

this code causes : 'undefined' is not an object ('evaluating Ti.UI.currentWindow.close') at ch_win.js


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images