smspoonam@gmail.com
hie this is poonam,, some roudy girl. By failing to prepare, you're preparing to fail.............................................. The intention is to be a FAQ/knowledgebase for Flex2b3 users. Since I noticed that a lot of similar questions are being repeated on the forums, this should solve a lot of problems. I shall be picking up any interesting topics that occur on the forums and their solutions here. Happy FlexDevelopers!
Friday, June 09, 2006
| | | | | | |Constructor CF/AS
Well in CF we use CFC's and they dont have an implicit constructor. Through best practices many developers have settled on making an init function that gets called by many framworks as a constructor. As far as code running before a function all, anything outside the cffunctions in a cfc will get run when the object is created. So you can make sure that your variables are initialized before your functions get called. Let me see if i can come up with a short example.
Ok so that is example code. no promises on errors :) But what it shows is that there are default values for fname and lname. You can update those by setting them as public properties, or you can create getters and setters to protect your data.
Actionscript has constructors. A class can have only one constructor and it must be a funtions named the same thing as the class. So an as class witha constructor might look like this.
package{
public class User{
public var fname:String;
public var lname:String;
public function User(){
this.fname='sim';
this.lname='bateman';
}
public function getName():String{
return this.fname + " " + this.lname;
}
}
}
SimpleQuery :Sending A Query Back to Flex
Mechanism 1
Based on the Art Catalog example from Ben Forta, I noticed you can assign the result property of an RO directly to the dataProvider as such:
Where roCFC is a RemoteObject that you defined, and someFunction being a function in that CFC. Though this is the most direct and fastest approach, it's about as unabstract as you're going to get. What's happening here is the dataProvider will automatically wrap an ICollectionView wrapper around the object if the object is not a member of a Collection based class.
Mechanism 2
To go back to the way I used to do things where you have a variable that you can assign the result of a query to in Flex 2 what you can do is wrap the ICollectionView yourself which gives you more flexability.
import mx.collections.ICollectionView; [Bindable] public var users:ICollectionView; public function resultHandler(event:ResultEvent):void { users = ICollectionView(event.result); }
What Are Blogs
Q: For the uninitiated, what are blogs? (In layman's terms, please.)
A: Blogs are public Web journals. 'Public' can mean a few different things, though. Usually blogs are world-visible. But they can also be company-visible, or department- or workgroup-visible.
Q: Why are they so important to InfoWorld now?
A: Here's an example. A couple of months ago, I wrote an item on my blog in response to an item on Scripting News about the Windows "blue screen of death." I used my posting to broaden the discussion, pointing out that device drivers are problematic in every operating system. In passing, I mentioned that Windows Server 2003 moves some HTTP networking code into the kernel, and wondered about the performance/stability tradeoff.
An hour later, I happened to check my Technorati cosmos -- that's a website (one of several) that keeps track of blogs that cite other blogs. In response to my posting, a Microsoft developer named Ari Pernick (whom I'd never heard of) posted an item on his blog that said, in part, "Well, it's a scary change, but hopefully appropriate." Ari went on to explain more than I'd seen or heard previously about this potentially controversial feature of Windows Server 2003. In so doing, he helped to defuse controversy.
Stop and think about this for a moment. Ari's not one of Microsoft's stars, like Don Box or Chris Anderson, both of whom have lately become fascinated with blogs. He's a footsoldier in Redmond's army of developers. And yet he felt empowered to clarify how and why part of the HTTP stack was pushed down into the Windows kernel.
Some in the journalistic, vendor, and user communities think that this kind of open, cross-blog conversation is the way of the future. If that's true, it'll change a lot of things -- including the nature of tech journalism.
A conspiracy theorist, noticing that Ari's blog went silent a few days after that extraordinary posting, might conclude that he'd been shut down. I'm not a conspiracy theorist, however. I see lots of other blogs cooking at Microsoft. Maybe Ari decided he's not cut out for public journalling, or just got too busy.
Maybe there's a real change underway, maybe not. And maybe that change will broadly transform the way information flows in the vendor/customer/journalist ecosystem. Time will tell. I certainly hope that that we're moving in the direction of more openness and transparency. That can't and shouldn't mean, of course, that people inside vendor or user organizations will divulge secrets on public blogs. It can and should mean they'll present real faces, and speak in real voices about issues of interest to colleagues, partners, and customers. Think of an organization as a single-celled animal. Blogs increase the surface area of the cell, help nutrients flow across its membrane, and promote multicellular cooperation.
You haven't asked why people write blogs. At first glance, the whole thing looks like a gigantic vanity press, and indeed there are elements of that. But every serious professional blog has an agenda. Reasons to invest time and effort in writing a blog can incude:
To promote yourself, your company, or (typically) both at the same time.
To influence the thinking of people inside and outside your organization.
To communicate directly with customers.
To advertise aspects of your internal process that are not proprietary, and that can benefit from the collaborative energy that a blog can attract.
The blog network is a kind of engine for processing all of these agendas. Think about how science is driven by publication and citation indexing. Blogs, and the aggregators that track them, make publication and citation indexing a realtime 24x7 process. The blog universe is a literal marketplace of ideas, an economy whose currency is the hyperlink.
Q: How do they work?
A: Technically, blogs are dead simple: static Web pages, with diary entries ordered newest to oldest. In a pinch, you could maintain one with nothing fancier than a text editor and an FTP program. There's a bit more to RSS (Rich Site Summary), the XML format that's the basis of a blog syndication network, but in the end it's dead simple too. The real innovations are cultural. In other modes of electronic discourse -- Usenet newsgroups, Web forums -- you join a shared public space and take turns speaking in that space. Blogs work very differently. Your blog is your own personal space, an extension of yourself that you project with pride, and control with care. You write about things that matter to you, optionally referring to other blogs and acknowledging other blogs' referrals to you. These referrals and acknowledgments are driven by the other cultural novelty of blogging: the use of RSS newsreaders to selectively tune into the "channels" broadcast by other bloggers.
Q: How are they integrated into InfoWorld's site?
A: The site points to InfoWorld-written blogs, and vice versa. And all of InfoWorld's print content flows out through RSS feeds advertised on the home page. But there should be more to the story, as I'll explain below.
Q: Kevin McKean said that blogs can be a distant early warning of something before it breaks in a conventional news story. Can you explain that?
A: I think that blogs can sometimes scoop conventional news stories, but can also support and deepen them. It depends on the nature of the story. Three of the five W's -- who, where, and when -- are becoming commodities exchanged at light speed on the RSS network. But the remaining two -- what and why -- require synthesis and analysis. Journalists who read and write blogs will find themselves better connected and more able to do that synthesis and analysis effectively.
Q: Do InfoWorld writers maintain blogs or do they monitor other people's blogs or both?
A: The balance between original writing and commentary is a matter of individual style.
Q: What does it mean to be a blog-friendly IT site?
A: More than just converting columnists into bloggers. It's a two-way street. InfoWorld's regular news, reviews, and features -- as well as our blogs -- are widely read and commented upon. Increasingly those comments appear on readers' weblogs, where Technorati, Popdex, other aggregators, and our own referral logs can track them. Chad Dickerson signed us up for a Technorati watchlist last week, and was blown away by the amount and quality of feedback reflected there. I'd like to see InfoWorld.com weave those perspectives into its presentation. Writing for the Columbia Journalism Review, Dan Gillmor says that journalism should "help the former audience become part of the process." I violently agree, and have in fact worked that way since about 1996. That's when I realized how the newsgroups I ran at BYTE.com could enrich the editorial process of BYTE magazine. What was then the exception is now -- I hope -- going to become the rule.
Flex Directory
Clarifying the Term "Flex"
I've noticed some confusion out there around the term "Flex". The term has evolved as our technology has evolved, and actually means something very different now than it did even just a few months ago. If you're a little confused about what we mean when we say Flex or Flex 2, this should clear things up.
I've decided to break this post down into two sections: Initial Flex Products, which describes how we started off using the term Flex, and Current Flex Products, which describes what Flex means today.
Initial Flex Products
* Flex 1.5: Flex 1.5 is probably what most of you think of when you think of Flex: an enterprise level presentation server. You write MXML, move it over to a server, and Flex compiles the MXML into a SWF, and serves up your application's presentation layer. You can compile your MXML "off-line" and just copy the resulting SWF over to your server, as well. Once your Flex application is running on the client, you can use web services or AMF to communicate with the server.
* Flex Builder 1.5: Flex Builder 1.5 is an authoring environment for Flex 1.5. It is based on the Dreamweaver code base, and gives you things like design and code view, syntax highlighting, code hinting, and application preview.
Current Flex Products
* Flex 2: Flex 2 is an umbrella term which refers to all the technologies in the Flex 2 product line including the Flex Framework, Flex Builder 2, and Flex Enterprise Services 2.
* Flex Framework 2: With the next generation of Flex technology, we have decoupled the framework from the products themselves. The Flex Framework consists of MXML (an XML-based language for declaratively building your applications), class libraries, components, containers, and effects. The Flex Framework can be used to build and style Flex applications without a server or any particular IDE. In fact, all you actually need to build Flex applications is the Flex Framework and the Flex compiler, both of which can be used on their own. Find out more about the Flex Framework here.
* Flex Builder 2: Flex Builder 2 is an entirely new product, and has almost nothing in common with Flex Builder 1.5. Flex Builder 2 is a brand new RIA IDE built on top of Eclipse, and is the easiest and most powerful way to build Flex applications. Flex Builder 2 makes developing Flex applications much simpler with features like an integrated compiler, code hinting, debugging, design view, source control system integration, and tons of other features. It will be available as both a standalone application, and as an Eclipse plugin that you can use with your existing Eclipse installation. Find out more about Flex Builder 2, and download an alpha release, here.
* Flex Enterprise Services 2: Flex Enterprise Services is basically the next generation of the Flex 1.5 server, but with tons of new functionality like automated testing, enterprise messaging support (which provides a publish/subscribe messaging infrastructure), and the Flex Data Services, which automatically synchronizes data manipulated locally with data on the server. Find out more about Flex Enterprise Services 2 here.
Other Flex-related Technologies
* Flex Charting Components 2: The Flex Charting Components 2 are a new set of customizable Flex components which provide very slick data visualization capabilities. Think of them as an extension to the Flex Framework. You can use them with Flex Builder 2 and Flex Enterprise Services. Find out more about the Flex Charting Components 2 here.
* Flex Compiler: Although Flex Builder 2 and Flex Enterprise Services both have the Flex compiler built in, it can also be used outside of either product. The compiler can be used for compiling MXML applications or ActionScript projects from the command line. Find out more about using the Flex compiler and Flex framework from the command line here and here.
* ActionScript 3: ActionScript 3 is the core of the Flex Framework. Although the syntax is similar to ActionScript 2, it is more object-oriented, more strongly typed, and because it executes inside a brand new virtual machine, it is much faster than ActionScript 2. ActionScript 3 is fully compliant with the ECMAScript 4 proposal (the standard JavaScript 2.0 is based on), and includes things like E4X and regular expressions. Find out more about ActionScript 3 here.
* Flash Player 8.5: Flash Player 8.5 is the newest version of the Flash Player, and is still in alpha. It is the client runtime for Flex 2 applications. The biggest addition to Flash Player 8.5 is the ActionScript 3 virtual machine. Find out more about Flash Player 8.5 here.







