[quoted text, click to view] On Sep 10, 12:37 pm, "chieffan" <webforumsu...@macromedia.com> wrote:
> I am using the Window component in the following manner. User clicks a button
> called audioText_btn and the window will popup with audio script, like a closed
> captioning. Up unitl 30 min ago I could publish with this code just fine. Now I
> get this error in all the files I used this in. As I said, all had published
> just fine. Any help is appreciated.
>
> **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 27: Type mismatch.
> var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true,
> {closeButton:true, title:"Script", contentPath:"contenttext"});
>
> Total ActionScript Errors: 1 Reported Errors: 1
>
> ----------------Here is my code----------------------
>
> import mx.managers.PopUpManager;
> import mx.containers.Window;
> audio_btn.onRelease = function() {
> _global.styles.windowStyles.setStyle("fontSize", "12");
> var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true,
> {closeButton:true, title:"Script", contentPath:"contenttext"});
> var winListener:Object = new Object();
> winListener.click = function() {
> my_win.deletePopUp();
> };
> my_win.addEventListener("click", winListener);
> winListener.complete = function(evt_obj:Object) {
> my_win.setSize(my_win.content._width+25, my_win.content._height+25);
> };
> my_win.addEventListener("complete", winListener);
> };
Hi, try casting the return of the PopUpManager!
var windowInstance = Window(PopUpManager.createPopUp(this, Window,
false, getWindowInitObject()));