Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2008, 11:25 AM
Registered User
 
Join Date: Feb 2008
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;
}
}

 
Old February 15th, 2008, 10:58 AM
Registered User
 
Join Date: Jun 2007
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 :)

 
Old February 15th, 2008, 01:01 PM
Registered User
 
Join Date: Feb 2008
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.

 
Old November 21st, 2008, 06:24 PM
Registered User
 
Join Date: Nov 2008
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";






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 01:32 PM
Customised events in C# LowFlyer VS.NET 2002/2003 2 July 15th, 2004 01:53 PM
help with Events egiblock JSP Basics 0 October 6th, 2003 11:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.