inheritance issue...

View: New views
10 Messages — Rating Filter:   Alert me  

inheritance issue...

by Trevor Burton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

First of all, thank you very much for mtasc, it’s going to save Sooooo much time compiling our applications….

 

I’ve spent the last 2 months re-factoring a huge multiplayer game application to work with mtasc and have an automated build process and I’m on the last leg and have hit a snag…

 

…we have a number of ‘modules’ in the application and each module has been broken into a skin, a library, a properties file and a stylesheet – the libraries and properties files being swfs compiled with mtasc. We have several clients using this application so each client has a different properties file for each module. Normally the properties files are just containers of positional values and such like, they don’t contain any functionality – however one does and is causing an issue with inheritance.

 

In the library for this module I have an MVC relationship – the properties for this client’s module extend the View for this relationship – but – when compiled the View doesn’t seem to be able to reference it’s super class. Tracing the value of ‘super’ gives [object Object] but tracing any of it’s properties gives nothing at all.

 

The Base Model, View and Controller are in one swf and the extensions are in another swf, both are loaded at the same time and not instantiated until both files are loaded so they are available.

 

I’ve tried ditching the extension and instantiating the super class directly in the child as a test and it works, so the class is definitely available – but at runtime there’s no extension.

 

My Team Leader feels it’s about multiple inheritance… I don’t – can anyone shed any light on this?

 

T


--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by Eric Priou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> My Team Leader feels it’s about multiple inheritance… I don’t – can  
> anyone shed any light on this?
How could we ?
----
Eric Priou
aka  erixtekila
Articles : http://www.v-i-a.net/inprogress
Oregano : http://www.v-i-a.net/inprogress/oregano



--
MTASC : no more coffee break while compiling

RE: inheritance issue...

by Trevor Burton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

By answering the question?

Is there a problem with multiple inheritance in mtasc? There seem to be
messages in the archives of this list but nothing that seems to suggest
why this particular case is occurring....

Thanks for you reply, though, really helpful

t

-----Original Message-----
From: mtasc-bounces@...
[mailto:mtasc-bounces@...] On Behalf Of Eric Priou
Sent: 22 February 2007 14:19
To: MotionTwin ActionScript2 Compiler List
Subject: Re: [mtasc] inheritance issue...


> My Team Leader feels it's about multiple inheritance... I don't - can

> anyone shed any light on this?
How could we ?
----
Eric Priou
aka  erixtekila
Articles : http://www.v-i-a.net/inprogress
Oregano : http://www.v-i-a.net/inprogress/oregano



--
MTASC : no more coffee break while compiling

--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by ronatartifact :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tracing the value of ‘super’ gives [object Object] but tracing any of
it’s properties gives nothing at all.

What does the property trace look like? "Nothing at all" is not
something easy to visualize as a trace output.

On what basis does your Team Leader make the assertion? What evidence?

Make sure that you are recompiling EVERY swf each time.
See previous discussions on class loading. Class definitions are only
loaded once. If an old definition is already loaded from an swf that you
did not rebuild, then your new definition will be ignored when it is seen.

First in Wins

Ron

Trevor Burton wrote:

>
> First of all, thank you very much for mtasc, it’s going to save Sooooo
> much time compiling our applications….
>
> I’ve spent the last 2 months re-factoring a huge multiplayer game
> application to work with mtasc and have an automated build process and
> I’m on the last leg and have hit a snag…
>
> …we have a number of ‘modules’ in the application and each module has
> been broken into a skin, a library, a properties file and a stylesheet
> – the libraries and properties files being swfs compiled with mtasc.
> We have several clients using this application so each client has a
> different properties file for each module. Normally the properties
> files are just containers of positional values and such like, they
> don’t contain any functionality – however one does and is causing an
> issue with inheritance.
>
> In the library for this module I have an MVC relationship – the
> properties for this client’s module extend the View for this
> relationship – but – when compiled the View doesn’t seem to be able to
> reference it’s super class. Tracing the value of ‘super’ gives [object
> Object] but tracing any of it’s properties gives nothing at all.
>
> The Base Model, View and Controller are in one swf and the extensions
> are in another swf, both are loaded at the same time and not
> instantiated until both files are loaded so they are available.
>
> I’ve tried ditching the extension and instantiating the super class
> directly in the child as a test and it works, so the class is
> definitely available – but at runtime there’s no extension.
>
> My Team Leader feels it’s about multiple inheritance… I don’t – can
> anyone shed any light on this?
>
> T
>


--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by ronatartifact :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As nearly as I can tell and from your own tests, multiple levels of
inheritance are not a problem.

Ron

Trevor Burton wrote:

> By answering the question?
>
> Is there a problem with multiple inheritance in mtasc? There seem to be
> messages in the archives of this list but nothing that seems to suggest
> why this particular case is occurring....
>
> Thanks for you reply, though, really helpful
>
> t
>
> -----Original Message-----
> From: mtasc-bounces@...
> [mailto:mtasc-bounces@...] On Behalf Of Eric Priou
> Sent: 22 February 2007 14:19
> To: MotionTwin ActionScript2 Compiler List
> Subject: Re: [mtasc] inheritance issue...
>
>
>  
>> My Team Leader feels it's about multiple inheritance... I don't - can
>>    
>
>  
>> anyone shed any light on this?
>>    
> How could we ?
> ----
> Eric Priou
> aka  erixtekila
> Articles : http://www.v-i-a.net/inprogress
> Oregano : http://www.v-i-a.net/inprogress/oregano
>
>
>
>  

--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by ronatartifact :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am not sure that the Flash player can tell the difference between your
test runs and your production runs.
If inheritance works in "Test" it works in "Production"

Ron


Trevor Burton wrote:

> By answering the question?
>
> Is there a problem with multiple inheritance in mtasc? There seem to be
> messages in the archives of this list but nothing that seems to suggest
> why this particular case is occurring....
>
> Thanks for you reply, though, really helpful
>
> t
>
> -----Original Message-----
> From: mtasc-bounces@...
> [mailto:mtasc-bounces@...] On Behalf Of Eric Priou
> Sent: 22 February 2007 14:19
> To: MotionTwin ActionScript2 Compiler List
> Subject: Re: [mtasc] inheritance issue...
>
>
>  
>> My Team Leader feels it's about multiple inheritance... I don't - can
>>    
>
>  
>> anyone shed any light on this?
>>    
> How could we ?
> ----
> Eric Priou
> aka  erixtekila
> Articles : http://www.v-i-a.net/inprogress
> Oregano : http://www.v-i-a.net/inprogress/oregano
>
>
>
>  

--
MTASC : no more coffee break while compiling

RE: inheritance issue...

by Trevor Burton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks ron, it's a mystery alright - if I include a copy of the 'middle'
class in the inheritance chain in the same package as the top member of
the chain then all is fine - it works, it's when it's in the library.swf
that it seems not to get recognized....

By nothing at all I mean absolutely nothing - like it doesn't trace or
even leave a blank line where a trace might be.... I was iterating
through the properties of super so it just didn't ever call a trace() as
there were no iterations carried out.

I've got a workaround (which is actually looking like a better solution
now anyway) it's a shame to have to do so much work for one button for
one client but never mind.

Thanks again for the help

T

-----Original Message-----
From: mtasc-bounces@...
[mailto:mtasc-bounces@...] On Behalf Of Ron Wheeler
Sent: 22 February 2007 14:37
To: MotionTwin ActionScript2 Compiler List
Subject: Re: [mtasc] inheritance issue...

Tracing the value of 'super' gives [object Object] but tracing any of
it's properties gives nothing at all.

What does the property trace look like? "Nothing at all" is not
something easy to visualize as a trace output.

On what basis does your Team Leader make the assertion? What evidence?

Make sure that you are recompiling EVERY swf each time.
See previous discussions on class loading. Class definitions are only
loaded once. If an old definition is already loaded from an swf that you

did not rebuild, then your new definition will be ignored when it is
seen.

First in Wins

Ron

Trevor Burton wrote:
>
> First of all, thank you very much for mtasc, it's going to save Sooooo

> much time compiling our applications....
>
> I've spent the last 2 months re-factoring a huge multiplayer game
> application to work with mtasc and have an automated build process and

> I'm on the last leg and have hit a snag...
>
> ...we have a number of 'modules' in the application and each module
has
> been broken into a skin, a library, a properties file and a stylesheet

> - the libraries and properties files being swfs compiled with mtasc.
> We have several clients using this application so each client has a
> different properties file for each module. Normally the properties
> files are just containers of positional values and such like, they
> don't contain any functionality - however one does and is causing an
> issue with inheritance.
>
> In the library for this module I have an MVC relationship - the
> properties for this client's module extend the View for this
> relationship - but - when compiled the View doesn't seem to be able to

> reference it's super class. Tracing the value of 'super' gives [object

> Object] but tracing any of it's properties gives nothing at all.
>
> The Base Model, View and Controller are in one swf and the extensions
> are in another swf, both are loaded at the same time and not
> instantiated until both files are loaded so they are available.
>
> I've tried ditching the extension and instantiating the super class
> directly in the child as a test and it works, so the class is
> definitely available - but at runtime there's no extension.
>
> My Team Leader feels it's about multiple inheritance... I don't - can
> anyone shed any light on this?
>
> T
>


--
MTASC : no more coffee break while compiling

--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by Eric Priou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> By answering the question?
Obviously.
But I just had the feeling that you just gave too few details.
>
> Is there a problem with multiple inheritance in mtasc? There seem  
> to be
> messages in the archives of this list but nothing that seems to  
> suggest
> why this particular case is occurring....

BTW, I had the sale kind of issue once.
But when I've thought of it after, I can't see any trouble in multi-
level inheritance chain.

As anyone knows, the inheritance is built backward from the __proto__  
property.
As any other pointer in flash, the variables are passed by reference  
for complex data (not primitive)
Then we should conclude that there couldn't get any problem with long  
inheritance chain because it's the same principe.

If the inheritance is broken, it do mean that the myObject.__proto__  
is not set correctly or unset at a time.
Who still continue to use the prototype property inside class's  
methods ?
Who use mixins like EventDispatcher.initialize ?
Maybe some part of your code do use those practices.

But definitively I think that inheritance is kept.

But maybe could you use composition to fix your very problem ?


Sorry to ping you back with my question.
HTH
----
Eric Priou
aka  erixtekila
Articles : http://www.v-i-a.net/inprogress
Oregano : http://www.v-i-a.net/inprogress/oregano



--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by Ralf Bokelberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not aware of a general issue with inheritance. Maybe you can
reduce your problem and show us some code?

Cheers
Ralf.

On 2/22/07, Eric Priou <erixtekila@...> wrote:

> > By answering the question?
> Obviously.
> But I just had the feeling that you just gave too few details.
> >
> > Is there a problem with multiple inheritance in mtasc? There seem
> > to be
> > messages in the archives of this list but nothing that seems to
> > suggest
> > why this particular case is occurring....
>
> BTW, I had the sale kind of issue once.
> But when I've thought of it after, I can't see any trouble in multi-
> level inheritance chain.
>
> As anyone knows, the inheritance is built backward from the __proto__
> property.
> As any other pointer in flash, the variables are passed by reference
> for complex data (not primitive)
> Then we should conclude that there couldn't get any problem with long
> inheritance chain because it's the same principe.
>
> If the inheritance is broken, it do mean that the myObject.__proto__
> is not set correctly or unset at a time.
> Who still continue to use the prototype property inside class's
> methods ?
> Who use mixins like EventDispatcher.initialize ?
> Maybe some part of your code do use those practices.
>
> But definitively I think that inheritance is kept.
>
> But maybe could you use composition to fix your very problem ?
>
>
> Sorry to ping you back with my question.
> HTH
> ----
> Eric Priou
> aka  erixtekila
> Articles : http://www.v-i-a.net/inprogress
> Oregano : http://www.v-i-a.net/inprogress/oregano
>
>
>
> --
> MTASC : no more coffee break while compiling
>


--
Ralf Bokelberg <ralf.bokelberg@...>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35

--
MTASC : no more coffee break while compiling

Re: inheritance issue...

by GianniF :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you are compiling code into an existing swf you need to recompile the fla when you change inheritance structures.

http://lists.motion-twin.com/pipermail/mtasc/2005-December/028813.html

I had this exact problem, I recompiled the swf from the flash IDE once, and then went back to mtasc.

Ralf Bokelberg-2 wrote:
I'm not aware of a general issue with inheritance. Maybe you can
reduce your problem and show us some code?

Cheers
Ralf.

On 2/22/07, Eric Priou <erixtekila@gmail.com> wrote:
> > By answering the question?
> Obviously.
> But I just had the feeling that you just gave too few details.
> >
> > Is there a problem with multiple inheritance in mtasc? There seem
> > to be
> > messages in the archives of this list but nothing that seems to
> > suggest
> > why this particular case is occurring....
>
> BTW, I had the sale kind of issue once.
> But when I've thought of it after, I can't see any trouble in multi-
> level inheritance chain.
>
> As anyone knows, the inheritance is built backward from the __proto__
> property.
> As any other pointer in flash, the variables are passed by reference
> for complex data (not primitive)
> Then we should conclude that there couldn't get any problem with long
> inheritance chain because it's the same principe.
>
> If the inheritance is broken, it do mean that the myObject.__proto__
> is not set correctly or unset at a time.
> Who still continue to use the prototype property inside class's
> methods ?
> Who use mixins like EventDispatcher.initialize ?
> Maybe some part of your code do use those practices.
>
> But definitively I think that inheritance is kept.
>
> But maybe could you use composition to fix your very problem ?
>
>
> Sorry to ping you back with my question.
> HTH
> ----
> Eric Priou
> aka  erixtekila
> Articles : http://www.v-i-a.net/inprogress
> Oregano : http://www.v-i-a.net/inprogress/oregano
>
>
>
> --
> MTASC : no more coffee break while compiling
>


--
Ralf Bokelberg <ralf.bokelberg@gmail.com>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35

--
MTASC : no more coffee break while compiling