Adobe Dreamweaver Forums



Last 10 THreads :         Objects "Framed" when moving layer (Last Post : VegasMirage@adobeforums.com - Replies : 2 - Views : 3 )           »          Creating images to look like original oil paintings? (Last Post : Ian_Courtney@adobeforums.com - Replies : 0 - Views : 1 )           »          Opening a file in navpane from toolbar (Last Post : ChrisRousset - Replies : 0 - Views : 1 )           »          Help importing PNG sequence (Last Post : []MULISH - Replies : 0 - Views : 1 )           »          Problems importing PNG sequence (Last Post : []MULISH - Replies : 0 - Views : 1 )           »          Flash CS4 grey Icons in the Tool Panels are hard to see (Last Post : rnfw - Replies : 0 - Views : 1 )           »          Strip EXIF camera data from PSD files? (Last Post : Russell_Proulx@adobeforums.com - Replies : 2 - Views : 3 )           »          CSH Calls for Merged CHM's (Last Post : TrentSnake - Replies : 0 - Views : 1 )           »          Image Replacement (Last Post : WhatNow - Replies : 0 - Views : 1 )           »          Embedding Flash SWF Skin in External Site (Last Post : QADesign - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:36 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Attn LuigiL :-) Problems using Flex Component Kit

Hi, Luigi;

I thought I'd appeal to our local Flash Component Kit expert. My end goal
is to be able to take a 3rd party component that is intended to be used in
Flash and make it usable in Flex. To this end, I've been trying to use the
Flex Component Kit to "wrap" this component.

One problem I have is that my Flex machine had the trial of Flash installed
on it before Flash was released, so it's not usable with Flash unless I
totally wipe it. This means that I have to build my swcs in one place and
transfer them to another. I've seen a couple of hints that maybe the swc
has to stay where it was built in order to work. This doesn't make any
sense to me, but maybe it is the root of my problem.

The first thing I tried was to create a new MC in the Library, drag the 3rd
party component into it, and convert that to a Flex component. When I put
the resulting swc in the root of my Flex project, code hinting allows me to
create <local:Flex3DWall/>, but it won't compile. It gives the error Type
was not found or was not a compile time constant for Flex3DWall.

I decided to dial it back and just aim for getting a button in my file. So
I created a new fla and added a new blank MC and dragged a button into it.
I converted that to a Flex component and put the resulting swc in the root
of my project. Then I tried adding <local:TestBtn/> to my Application.
Again, the code hinting found it no problem, but again it wouldn't compile
with the error Could not resolve <local:TestBtn> to a component
implementation.

Any idea what's going on here?

Thanks;

Amy




Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:36 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit


"Amy Blankenship" <amySpamFilter@magnolia_pleaseNOspam_multimedia.co m> wrote
in message news:gdli5n$m2a$1@forums.macromedia.com...
> Hi, Luigi;
>
> I thought I'd appeal to our local Flash Component Kit expert. My end goal
> is to be able to take a 3rd party component that is intended to be used in
> Flash and make it usable in Flex. To this end, I've been trying to use
> the Flex Component Kit to "wrap" this component.
>
> One problem I have is that my Flex machine had the trial of Flash
> installed on it before Flash was released, so it's not usable with Flash
> unless I totally wipe it. This means that I have to build my swcs in one
> place and transfer them to another. I've seen a couple of hints that
> maybe the swc has to stay where it was built in order to work. This
> doesn't make any sense to me, but maybe it is the root of my problem.
>
> The first thing I tried was to create a new MC in the Library, drag the
> 3rd party component into it, and convert that to a Flex component. When I
> put the resulting swc in the root of my Flex project, code hinting allows
> me to create <local:Flex3DWall/>, but it won't compile. It gives the
> error Type was not found or was not a compile time constant for
> Flex3DWall.
>
> I decided to dial it back and just aim for getting a button in my file.
> So I created a new fla and added a new blank MC and dragged a button into
> it. I converted that to a Flex component and put the resulting swc in the
> root of my project. Then I tried adding <local:TestBtn/> to my
> Application. Again, the code hinting found it no problem, but again it
> wouldn't compile with the error Could not resolve <local:TestBtn> to a
> component implementation.
>
> Any idea what's going on here?


Never mind. I figured that since my swcs were in the root, they would
automatically be in the build path. :-)


Reply With Quote
  #3 (permalink)  
Old 11-03-2008, 04:37 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit

Amy, sorry I wasn't there to assist you with this but due to the differences in
timezone (I'm in the Netherlands) I was most likely having some shuteye. If you
still have issues with this, let me know.
The 3DWall will probably not work when converted to a Flex Component. I've
seen some attempts, but I haven't seen it running in a Flex App yet.

Reply With Quote


  #4 (permalink)  
Old 11-03-2008, 04:37 AM
Karl_Sigiscar_1971
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit

I usually add the SWCs resulting from compiling Flex components from Flash CS3
to my Flex project in the lib folder. Another option is to create a swc folder
and put all your SWC files in, then edit the project properties and add the
path to either the swc/ folder or each SWC file.


Reply With Quote
  #5 (permalink)  
Old 11-03-2008, 04:37 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit


"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdmkmf$65m$1@forums.macromedia.com...
> Amy, sorry I wasn't there to assist you with this but due to the
> differences in
> timezone (I'm in the Netherlands) I was most likely having some shuteye.
> If you
> still have issues with this, let me know.
> The 3DWall will probably not work when converted to a Flex Component. I've
> seen some attempts, but I haven't seen it running in a Flex App yet.


That's perfectly ok :-). We all have to sleep sometimes.

I have a deal with my client that if I get it to work I can share the
solution, so I'll post back if I do. I'm often too stupid to know what I
can't do ;-)


Reply With Quote
  #6 (permalink)  
Old 11-03-2008, 04:37 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit

Good luck then!
Reply With Quote


  #7 (permalink)  
Old 11-03-2008, 04:37 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit


"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdnf3g$c1b$1@forums.macromedia.com...
> Good luck then!


OK, I'm having another problem. If I give my 3Dwall component in my Flash
symbol an instance name so I can control it, I get an error 1120
http://bugs.adobe.com/jira/browse/SDK-11360


If I create a class file for the symbol and define a public var of type MC
for it, I get an error 1151
http://curtismorley.com/2008/05/06/f...sh-error-1151/.

If I tell Flash not to declare instances automatically, this compiles, but
throws a Type Coercion error 1034 in Flex. If I type the public variable as
3Dwall, Flash tells me it expects a semicolon in front of "DWall", perhaps
because Types shouldn't begin with numbers? The code assist in Flash offers
this as a valid data type, but not Wall3DPro, which is the class the
commponent is linked to, according to the linkage.

Is there a way to control this guy through AS without giving him an instance
name?

TIA;

Amy


Reply With Quote
  #8 (permalink)  
Old 11-03-2008, 04:37 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit

No, at least not with the standard workflow 'Convert symbol to Flex Component'.
The instance name you assign is used to assign a class to the symbol which is
necessary to provide a class that extends UIMovieClip. That is done
automatically but - as Peter Ent describes in his example - you can also assign
a class yourself. You followed the correct steps:

The first thing I tried was to create a new MC in the Library, drag the 3rd
party component into it, and convert that to a Flex component.

The next to do is what Karl_Sigiscar_1971 describes:
I usually add the SWCs resulting from compiling Flex components from Flash CS3
to my Flex project in the lib folder.

What I do is right click the Flex Project -> properties -> Flex Build Path ->
Library Path -> Add swc
and just point to the generated swc

If you now get codehinting in the Flex Project, the swc was compiled
correctly. If something is wrong with the swc, you'll get a hint like
<local:uninitialized

I don't have the component in question, but similarly I can't convert the
JWPlayer to a Flex Component because of the way that player is initialized. So,
maybe that is the case here too, but of course I can't be sure.

Grant Skinner came up with another way to use Flash symbols in Flex:
http://www.gskinner.com/blog/archive...flash_sym.html

A little bit more involved, but it might give you some extra info on the topic
and maybe leads to a solution. Let me know how it works out. Good luck!

Reply With Quote
  #9 (permalink)  
Old 11-03-2008, 04:37 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit


"LuigiL" <webforumsuser@macromedia.com> wrote in message
news:gdpbi0$2nj$1@forums.macromedia.com...
> No, at least not with the standard workflow 'Convert symbol to Flex
> Component'.
> The instance name you assign is used to assign a class to the symbol which
> is
> necessary to provide a class that extends UIMovieClip. That is done
> automatically but - as Peter Ent describes in his example - you can also
> assign
> a class yourself. You followed the correct steps:


I think maybe I didn't communicate correctly. I created a new MovieClip
that I called FlexWall, and associated that with an as file that extends
UIMovieClip. Then I dragged a 3DWall component onto the stage. This all
worked (or at least didn't generate any errors but also showed nothing on
screen in Flex), but of course I couldn't do anything with that component,
because it didn't have an instance name. I named the instance "wall", and
that's when I started having the issues.

I also had the same problem with naming my button instance in my scaled back
button component. I'm thinking there's just something I'm missing about how
to use instance names in a class you're going to use for a component--I had
this very same issue over a year ago when I was taking CS3 training at
Adobe, but to be honest the instructor didn't know Flash very well and
couldn't troubleshoot the problem.

Unfortunately, this is not spelled out very well in the component
documentation, so I think I'm just missing something simple that people who
have surmounted it just take for granted.

Thanks!

Amy


Reply With Quote


  #10 (permalink)  
Old 11-03-2008, 04:37 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Attn LuigiL :-) Problems using Flex Component Kit

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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© 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 04:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk