"manofspirit" <webforumsuser@macromedia.com> wrote in
message
news:gau3l5$jpv$1@forums.macromedia.com...
> Thanks, But how will i reference it from a component?
> using mx.core.Applucation or is there anyother way?
>
> Thanks Greg
>
>
> @Q:2
> Can i embed a sound file in CSS? :S

"MotionMaker" <webforumsuser@macromedia.com> wrote in
message
news:gaugqb$6c4$1@forums.macromedia.com...
> Of course having a central data model is better but if
your Main.mxml is
> serving as a central location for "global" data you can
use these
>
> this.parentApplication.sndCls
> Main.sndCls
> Application.application.sndCls

Of course, that means that the component won't work in
applications that
don't have that particular variable defined. Passing the
reference in will
allow for a more loosely coupled component. I guess it all
depends on how
much you want to reuse the component...

"MotionMaker" <webforumsuser@macromedia.com> wrote in
message
news:gb0jr3$or0$1@forums.macromedia.com...
> Amy you are correct and I agree. It will limit the
development in other
> reconfigurations. But it looks like manofspirit was
looking for an
> expedient solution.

Well best practice as to coding may influenced by the
architecture in this case.

It may be expedient if this sound file is a one time use and
will only be in a component, to put it there and leave it.

If it may be used by multiple components, then you could
consider passing it as a var to each. However your component then
is limited because it cannot be contained in a new component
without the new component also exposing this variable to get the
data down to its children. Thus the problem with passing data down
a composition pattern. Add to that the need to get another variable
to a component that is now deep in a composition pattern.

So as I had mentioned a model containing this data might be a
best practice in a MVC architecture.

So I would say more information would be required for me to
make a judgment as to best practice.