Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Adobe Flex 2 ISBN: 978-0-470-10267-1
This is the forum to discuss the Wrox book Professional Adobe Flex 2 by Rich Tretola, Simon Barber, Renaun Erickson; ISBN: 9780470102671
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Adobe Flex 2 ISBN: 978-0-470-10267-1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 13th, 2008, 11:25 AM
Registered User
 
Join Date: Feb 2008
Location: NYC, New York, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cairngorm events

Why are the public variables passed in with the constructor in the GetWeatherEvent class below? Thanks
package com.wiley.proflex2.chapter21.events
{
import com.adobe.cairngorm.control.CairngormEvent;
import com.wiley.proflex2.chapter21.control.ApplicationCo ntroller;

public class GetWeatherEvent extends CairngormEvent
{
public function GetWeatherEvent(locationId:String, unit:String)
{
super( ApplicationController.EVENT_GET_WEATHER );
this.locationId = locationId;
this.unit = unit;
}

public var locationId : String;
public var unit : String;
}
}

Reply With Quote
  #2 (permalink)  
Old February 15th, 2008, 10:58 AM
Registered User
 
Join Date: Jun 2007
Location: Cape Town, , South Africa.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well ideally you could create private variables and pass them into the constructor or leave them public and take them out of the constructor. There is no specific reason for it just easier to do it on one line of code :)

Reply With Quote
  #3 (permalink)  
Old February 15th, 2008, 01:01 PM
Registered User
 
Join Date: Feb 2008
Location: NYC, New York, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. My first Flex app is a Cairngorm application and I wanted to make sure that this was just done for convenience.

Reply With Quote
  #4 (permalink)  
Old November 21st, 2008, 06:24 PM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In that same passage, why refer to the FrontController to get the event type? super( ApplicationController.EVENT_GET_WEATHER) seems to be referring to the EVENT_GET_WEATHER_BY_LOCATION const in the code example Listing 21-8. Shouldn't this string instead be defined in the event class itself, something like:

public static var EVENT_GET_WEATHER_BY_LOCATION:String = "getWeatherByLocation";

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Events bschleusner C# 2005 2 February 26th, 2007 05:25 AM
Page Events aware Javascript 2 November 8th, 2006 07:01 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 02:32 PM
Customised events in C# LowFlyer VS.NET 2002/2003 2 July 15th, 2004 02:53 PM
help with Events egiblock JSP Basics 0 October 7th, 2003 12:39 AM



All times are GMT -4. The time now is 04:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.