For me it all depends on what your using and where your using it.

{} for tweenlite / tweenmax is great.

and for

When you want to init something with values at creation/instation/init time
without modifying them at a later point yep.

Kind of feels like the hackery they call javascript oop and jquery etc... ;)

I sometimes create a paramaters object class which handles this (and for
various other reasons... partial model) but for someone who is not familiar
with the application or api this will be added complexity.

At the end of the day... If it works... It works for me... Productivity and
quality are the priorities for me. RAD

D




On 12 August 2011 22:57, richardolsson <[email protected]> wrote:

> The subject of the question are the much discussed "init objects",
> which some people liked and some people hated. They would let you
> specify constructor arguments in any order, and omit any for which the
> default value was fine, much like what is natively supported in Python
> for instance. Unfortunately, it removes the benefits of strong typing,
> and made it much harder to document.
>
> In Away3D 4 we have decided to retire them in favor of typed
> constructor arguments. For some classes this means that you cannot do
> as much in the constructor as you could in earlier versions of Away3D,
> but most of the time you can do the same thing using properties.
>
> Anyway, this is very expected mistake for someone coming from Away3D
> 2.x/3.x, and has nothing to do with object-oriented vs procedural
> programming.
>
> @Laani:
> I'm glad you solved it! :)
>
>
> Cheers
> /R
>
> On Aug 12, 10:11 am, Michael Iv <[email protected]> wrote:
> > You could also do it this way , I mean passing a Scene3d variable into
> View constructor. The error you got is due to the fact that instead passing
> Scene3d instance you pass an Object which wraps Scene3d. This has nothing to
> do with Away3d , it is pure actionscript stuff: remember ,curly braces in AS
> mean Object class . Unlike in C# or or any C Lang where it is array .
> >
> > Sent from my iPhone
> >
> > On Aug 12, 2011, at 3:23 AM, Laani <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Problem solved!
> >
> > > instead of using the above syntax. I've used this syntax and it
> > > works.
> >
> > > view = new View3D(scene1);
> >
> > > I think they have simplified the code in away4.0.
> >
> > > On Aug 12, 10:16 am, Laani <[email protected]> wrote:
> > >> Can somebody help me with this simple but puzzling error.
> >
> > >> I'm trying to pass a scene3D variable  into my view3D and I get a
> > >> compile error. I have no issues when I don't pass in any parameters.
> >
> > >> Here is the code:
> >
> > >>                         scene1 = new Scene3D();
> > >>                         view = new View3D({scene:scene1});
> >
> > >> Here is the error:
> >
> > >>       1118          Implicit coercion of a value with static type
> Object to
> > >> a possibly unrelated type away#d.containers.Scene3D
> >
> > >> Thanks!
>

Reply via email to