 |
 |
|
|
|
 |
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdq4so$61u$1@forums.macromedia.com...
> Ok. From scratch:
> Create a new as3 fla file. From the Components view, drag an instance of
> the
> 3DWallPro to the stage. Select the instance on the stage and from menu
> 'Modify', select 'Convert To Symbol' and select Movieclip. Give the symbol
> an
> instance name like TheWall (this instance name becomes the identifier in
> Flex)
> and set the registration point to the upper left corner. Klik OK. Now
> select
> the symbol in the library and from menu 'Commands' select 'Convert symbol
> to
> Flex Component'. The output panel will report what has been done to
> convert the
> symbol to a Flex Component. Except for the fact that automatically a class
> has
> been assigned to the symbol with the name 'TheWall' (or the instance name
> you
> assigned in the previous steps).
>
> With
> Now when you look at the publish settings -> flash -> AS3 -> settings,
> check
> if 'Automatically declare stage instances' is off. OK and close the
> Publish
> Settings.
>
> Doubleclick the symbol on the stage. Select the instance of the 3DWallPro
> component. Give it an instance name like 'wall'.
>
> Now create a new actionscript class and save it as TheWall.as (remember,
> the
> name must match the instance name of the symbol). Make sure it extends
> UIMovieClip and import mx.flash.UIMovieClip
> Declare a
> public var wall:
> and here you need to assign to correct datatype which is most likely the
> tricky thing here.
> You already checked the datatype of the 3DWallPro by checking the linkage.
> That must be the datatype of the public var wall otherwise you won't have
> access to the API of the component. Assign the correct datatype. Save the
> class.
> Now publish.
I tried that as well, and it gave me a Type coercion error. It looks like
the correct type is _3DWallPro, despite the fact that this isn't referenced
anywhere. Or at least the error message in FB says
Error #1034: Type Coercion failed: cannot convert _3DWallPro@4d102a9 to
Wall3DPro.
I'm going to step back and take this from a button and get that working
exactly like I want, and hopefully that will shed some light.
Thanks again :-)
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
I'm almost tempted to buy the component to try this myself :-).
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
"Amy Blankenship" <amySpamFilter@magnolia_pleaseNOspam_multimedia.co m> wrote
in message news:gdq5kp$76t$1@forums.macromedia.com...
>
> "LuigiL" <webforumsuser@macromedia.com> wrote in message
> news:gdq4so$61u$1@forums.macromedia.com...
>> Ok. From scratch:
>> Create a new as3 fla file. From the Components view, drag an instance of
>> the
>> 3DWallPro to the stage. Select the instance on the stage and from menu
>> 'Modify', select 'Convert To Symbol' and select Movieclip. Give the
>> symbol an
>> instance name like TheWall (this instance name becomes the identifier in
>> Flex)
>> and set the registration point to the upper left corner. Klik OK. Now
>> select
>> the symbol in the library and from menu 'Commands' select 'Convert symbol
>> to
>> Flex Component'. The output panel will report what has been done to
>> convert the
>> symbol to a Flex Component. Except for the fact that automatically a
>> class has
>> been assigned to the symbol with the name 'TheWall' (or the instance name
>> you
>> assigned in the previous steps).
>>
>> With
>> Now when you look at the publish settings -> flash -> AS3 -> settings,
>> check
>> if 'Automatically declare stage instances' is off. OK and close the
>> Publish
>> Settings.
>>
>> Doubleclick the symbol on the stage. Select the instance of the 3DWallPro
>> component. Give it an instance name like 'wall'.
>>
>> Now create a new actionscript class and save it as TheWall.as (remember,
>> the
>> name must match the instance name of the symbol). Make sure it extends
>> UIMovieClip and import mx.flash.UIMovieClip
>> Declare a
>> public var wall:
>> and here you need to assign to correct datatype which is most likely the
>> tricky thing here.
>> You already checked the datatype of the 3DWallPro by checking the
>> linkage.
>> That must be the datatype of the public var wall otherwise you won't have
>> access to the API of the component. Assign the correct datatype. Save the
>> class.
>> Now publish.
>
> I tried that as well, and it gave me a Type coercion error. It looks like
> the correct type is _3DWallPro, despite the fact that this isn't
> referenced anywhere. Or at least the error message in FB says
> Error #1034: Type Coercion failed: cannot convert _3DWallPro@4d102a9 to
> Wall3DPro.
>
>
>
> I'm going to step back and take this from a button and get that working
> exactly like I want, and hopefully that will shed some light.
OK, I'm a lot closer. I'm still a bit fuzzy on what's going on, but here's
what finally maybe got me an inspectable 3DWall in Flex (still nothing
visible on stage, but if I can see it in code I'm confident I can get
there).
New Project>New Symbol (FlexWall)
Drag 3Dwall onto stage of FlexWall.
Convert FlexWall to Flex component
Create FlexWall.as, extending UIMovieClip
Change FlexWall baseClass back to MovieClip
Change Document class to UIMovieClip
Turn off declare instances automatically
Turn declare instances automatically back on, and remove the public variable
wall from the AS.
I'm not sure what combination/sequence of settings worked, since there's a
lot of conflicting information out there. I'm going to try to go through
all this step by step at some point and write a tutorial, which will
hopefully clarify what's going on.
Thanks;
Amy
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
>>Change Document class to UIMovieClip
Hmm, don't know what the effect of that could be. The class that is connected
to the symbol is your 'gateway' to the 3DWallPro component. As far as I know
the Document Class doesn't affect the published swc. I'm curious what you come
up with. So, ultimately you should get a type coercion error when adding the
generated component to the application (the famous 'must extend IUIComponent')
>>Turn declare instances automatically back on
That would be a nice attempt when you can't datatype the public var so you can
see what the compiler thinks of the datatype.
In the train I thought about this and if I had to try to get this working I
would probably try to create a new component in Flash that 'has' an instance of
the 3DWallPro component. And ultimately wrap that in a symbol and convert it to
a Flex Component. Somehow my feeling is that it needs some kind of 'bridge' to
work.
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
We are discussing the conversion to a Flex Component but just to be complete on this: using SWFLoader and loading the component as a swf works ok. Thought I needed to mention this.
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdqk3m$qki$1@forums.macromedia.com...
> We are discussing the conversion to a Flex Component but just to be
> complete on this: using SWFLoader and loading the component as a swf works
> ok. Thought I needed to mention this.
Yes, but I'm very stubborn :-)
|

11-03-2008, 04:37 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdqhma$nfp$1@forums.macromedia.com...
>>>Change Document class to UIMovieClip
>
> Hmm, don't know what the effect of that could be. The class that is
> connected
> to the symbol is your 'gateway' to the 3DWallPro component. As far as I
> know
> the Document Class doesn't affect the published swc.
Something I came across somewhere suggested it as a solution to some
problem. Don't remember where/why, but it definitely seems to change the
behavior. I'm not sure I've nailed down the exact cause/effect relationship
of everything.
> I'm curious what you come
> up with. So, ultimately you should get a type coercion error when adding
> the
> generated component to the application (the famous 'must extend
> IUIComponent')
No, since it's extending UIMoviClip, that seems to be ok. It's kind of
aggravating it doesn't support commitProperties...I had to write that back
in.
> >>Turn declare instances automatically back on
> That would be a nice attempt when you can't datatype the public var so you
> can
> see what the compiler thinks of the datatype.
>
> In the train I thought about this and if I had to try to get this working
> I
> would probably try to create a new component in Flash that 'has' an
> instance of
> the 3DWallPro component. And ultimately wrap that in a symbol and convert
> it to
> a Flex Component. Somehow my feeling is that it needs some kind of
> 'bridge' to
> work.
But you ultimately wind up that you have that "has a" thing that you have to
refer to. So if you create a new MC and drag a 3DWall onto the stage, that
MC "has a" 3D wall in it that you need to be able to refer to somehow. If
you make its class file extend UIMovieClip, it "is a" UIMovieClip that "has
a" 3D wall.
The steps above did eventually result in a Flex component that shows the
images in Flex and can be passed a path to the xml and work. The next step
is allowing setting of other properties. I've written a public method on it
that doesn't appear to be visible from Flex.
I'm also getting a problem where it doesn't like my reference to
closeWall(), but I'm sure I'll get there eventually.
|

11-03-2008, 04:38 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
Great! Then by the end of the day you will have it working :-)
Strange that the Document class has any influence on this. You do mean the Document class of the main timeline in the fla?
|

11-03-2008, 04:38 AM
|
|
|
Re: Attn LuigiL :-) Problems using Flex Component Kit
"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdrttv$k7n$1@forums.macromedia.com...
> Great! Then by the end of the day you will have it working :-)
> Strange that the Document class has any influence on this. You do mean the
> Document class of the main timeline in the fla?
Yes. I keep getting errors about closeWall() not being defined, even though
I've commented out the reference to it. Very aggravating.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners. Proud member
of the Camley Interactive Network
All times are GMT. The time now is 03:18 AM.
|