I wasnt trying to say dont do it. I was more pointing out that <mx:*> tags become AS so in theory most anything you can do in a tag you can do in AS. I was also pointing out to go into that with your eyes wide open, to not undue the advantages of a tag driven design.
Dave Wolf Cynergy Systems, Inc. Macromedia Flex Alliance Partner http://www.cynergysystems.com Email: [EMAIL PROTECTED] Office: 866 --- In [email protected], "Mink, Joseph" <[EMAIL PROTECTED]> wrote: > > It depends on how you're going about your code base. If you take a > Struts-like MVC approach, hardly ANY code is in your mxml (or JSP) > files. Most of the dynamic code would be found in AS (or Java) classes > totally outside your presentation (mxml/jsp) files. > > My problem was that deep in the bowels of my AS classes, I would need to > make a WS call. But I couldn't just create a WS client because it had > to be defined in mxml. So I had to either expose a method in the script > section of the mxml file that would make the WS call, or I had to have a > reference to the WS object that was defined in the mxml. > > Of course there are many refuting that, saying that you can do it if you > want (and I'm sure they're right), but we payed a ridiculous amount for > support and so I just assumed stick with what was documented so we could > be on the same wavelength as our tech support from Macromedia. > > My issue with the mxml-only defined WS objects was that it made it hard > to organize the AS classes that needed to make WS calls. > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Dave Wolf > Sent: Tuesday, October 11, 2005 5:55 PM > To: [email protected] > Subject: [flexcoders] Re: WebServices via ActionScript > > > I may be out of the loop because I couldnt see which thread you broke > from but.... > > You can turn on the keep-generated to keep the generated AS from a > <mx:WebService> call to prove its possible as well. Since at runtime > the J2EE Servlet Filter is generating AS from the <mx:*> tags pretty > much anything you can do in a tag you can do in AS right? > > The real question is why? You used to see this in JSP development a > lot (Since JSP is a nearly direct analog to Flex) in that JSP > developers would just make huge scriplet sections and do everything in > Java. Eventually it reached the point that why not just write a darn > servlet. Since at runtime the JSP is just codegenerated to java and a > servlet runs. > > Flex is the same right. The MXML is code generated in AS. I worry > about Flex ending up like JSPs with huge script sections and wondering > why you didnt just use Flash itself. > > > > Dave Wolf > Cynergy Systems, Inc. > Macromedia Flex Alliance Partner > http://www.cynergysystems.com > > Email: [EMAIL PROTECTED] > Office: 866-CYNERGY x85 > > > --- In [email protected], "JesterXL" <[EMAIL PROTECTED]> wrote: > > > > Starting a new thread since we hijacked the other one. > > > > I tested this and it works in Flex 1.5 and Flash 8. > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" > > initialize="getFunky()"> > > <mx:Script> > > <![CDATA[ > > > > import mx.services.WebService; > > import mx.services.PendingCall; > > > > var myWebServiceObject:WebService; > > var MyPendingCallObject:PendingCall; > > > > > > public var debug_str:String = ""; > > > > function getFunky() > > { > > d("WebService: " + WebService); > > var theURL = "http://radio.tapper.net/artist.cfc?wsdl"; > > myWebServiceObject = new WebService(theURL); > > MyPendingCallObject = myWebServiceObject.getCurrentSong(); > > d("Made call..."); > > MyPendingCallObject.onResult = function(result) > > { > > mx.core.Application.application.d("result: " + result); > > for(var p in result) > > { > > mx.core.Application.application.d(p + ": " + result[p]); > > } > > } > > MyPendingCallObject.onFault = function(fault) > > { > > mx.core.Application.application.d("fault: " + fault); > > for(var p in fault) > > { > > mx.core.Application.application.d(p + ": " + fault[p]); > > } > > } > > } > > > > function d(o) > > { > > debug_str += o + "\n"; > > } > > > > > > ]]> > > </mx:Script> > > > > <mx:TextArea text="{debug_str}" width="400" height="300" /> > > </mx:Application> > > > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > ________________________________ > > YAHOO! GROUPS LINKS > > > > * Visit your group "flexcoders > <http://groups.yahoo.com/group/flexcoders> " on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/> . > > > ________________________________ > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

