2
votes

I'm new to ac3 can you help me please.

getting this error 1084: Syntax error: expecting rightbrace before dot.

   {}.progress = function (event:ProgressEvent) : void
1
can't you just create a named object var magic:Object = {}; then magic.progress = function(e:ProgressEvent):void {}; ? - Lukasz 'Severiaan' Grela

1 Answers

3
votes

it is kind of mystery why you want to do this in that way, however casting as Object as follows avoids the error

({} as Object).progress = function(e:Event):void { };

also it is better to have a named object like so:

var magic:Object = {};
magic.progress = function(e:ProgressEvent):void {};

also if you really want anonymous object:

{
    progress:function(e:Event):void
    {}
};

best regards