I was testing custom cursors in an AIR Window this past week and I found some strange behavior. If tried to change the default cursor in an AIR Window by calling :
CursorManager.setBusyCursor()
The cursor in the main WindowedApplication changed rather than the cursor in my AIR Window. So, how could I change just the cursor in my AIR Window. The answer is to use a lower case “cursorManager” on the Window. So, I needed to call:
myAIRWindow.cursorManager.setBusyCursor();
Source from http://butterfliesandbugs.wordpress.com/2008/09/04/how-to-get-a-custom-cursor-in-an-air-window/
Thursday, July 29, 2010
Thursday, July 22, 2010
Programming in Object-C 2.0
This book is divided into three logical parts. Part I,“The Objective-C 2.0 Language,”
teaches the essentials of the language. Part II,“The Foundation Framework,” teaches how
to use the rich assortment of predefined classes that form the Foundation framework. Part
III,“Cocoa Programming and the iPhone SDK,” gives you an overview of Cocoa’s Application
Kit framework and then walks you through the process of developing a simple
iPhone application using the UIKit framework, and developing and debugging the code
with Xcode and Interface Builder.
A framework is a set of classes and routines that have been logically grouped together to
make developing programs easier. Much of the power of programming in Objective-C
rests on the extensive frameworks that are available.
Chapter 2,“Programming in Objective-C,” begins by teaching you how to write your
first program in Objective-C.
Because this is not a book on Cocoa programming, graphical user interfaces (GUIs)
are not extensively taught and are hardly even mentioned until Part III. So an approach
was needed to get input into a program and produce output. Most of the examples in this
text take input from the keyboard and produce their output in a window: a Terminal
window if you’re using gcc from the command line, or a Console window if you’re using
Xcode.
Chapter 3,“Classes, Objects, and Methods,” covers the fundamentals of object-oriented
programming.This chapter introduces some terminology, but it’s kept to a minimum.
I also introduce the mechanism for defining a class and the means for sending
messages to instances or objects. Instructors and seasoned Objective-C programmers will
notice that I use static typing for declaring objects. I think this is the best way for the student
to get started because the compiler can catch more errors, making the programs
more self-documenting and encouraging the new programmer to explicitly declare the
data types when they are known.As a result, the notion of the id type and its power is not
fully explored until Chapter 9,“Polymorphism, Dynamic Typing, and Dynamic Binding.”
Chapter 4,“Data Types and Expressions,” describes the basic Objective-C data types
and how to use them in your programs.
Chapter 5,“Program Looping,” introduces the three looping statements you can use in
your programs: for, while, and do.
Making decisions is fundamental to any computer programming language. Chapter 6,
“Making Decisions,” covers the Objective-C language’s if and switch statements in detail.
Chapter 7,“More on Classes,” delves more deeply into working with classes and objects.
Details about methods,multiple arguments to methods, and local variables are discussed
here.
Chapter 8,“Inheritance,” introduces the key concept of inheritance.This feature makes
the development of programs easier because you can take advantage of what comes from
above. Inheritance and the notion of subclasses make modifying and extending existing
class definitions easy.
Chapter 9 discusses three fundamental characteristics of the Objective-C language.
Polymorphism, dynamic typing, and dynamic binding are the key concepts covered here.
Chapters 10–13 round out the discussion of the Objective-C language, covering issues
such as initialization of objects, protocols, categories, the preprocessor, and some of the
underlying C features, including functions, arrays, structures, and pointers.These underlying
features are often unnecessary (and often best avoided) when first developing objectoriented
applications. It’s recommended that you skim Chapter 13,“Underlying C
Features,” the first time through the text and return to it only as necessary to learn more
about a particular feature of the language.
Part II begins with Chapter 14,“Introduction to the Foundation Framework,” which
gives an introduction to the Foundation framework and how to access its documentation.
Chapters 15–19 cover important features of the Foundation framework.These include
number and string objects, collections, the file system, memory management, and the
process of copying and archiving objects.
By the time you’re done with Part II, you will be able to develop fairly sophisticated
programs in Objective-C that work with the Foundation framework.
Part III starts with Chapter 20,“Introduction to Cocoa.” Here you’ll get a quick
overview of the Application Kit that provides the classes you need to develop sophisticated
graphical applications on the Mac.
Chapter 21,“Writing iPhone Applications,” introduces the iPhone SDK and the UIKit
framework.This chapter illustrates a step-by-step approach to writing a simple iPhone (or
iTouch) application, followed by a calculator application that enables you to use your
iPhone to perform simple arithmetic calculations with fractions.
Because object-oriented parlance involves a fair amount of terminology,Appendix A,
“Glossary,” provides definitions of some common terms.
Appendix B,“Objective-C Language Summary,” gives a summary of the Objective-C
language, for your quick reference.
Appendix C,“Address Book Source Code,” gives the source code listing for two classes
that are developed and used extensively in Part II of this text.These classes define address card and address book classes. Methods enable you to perform simple operations such as
adding and removing address cards from the address book, looking up someone, listing
the contents of the address book, and so on.
After you’ve learned how to write Objective-C programs, you can go in several directions.
You might want to lean more about the underlying C programming language—or
you might want to start writing Cocoa programs to run on Mac OS X, or develop more
sophisticated iPhone applications. In any case,Appendix D,“Resources,” will guide you in the right direction.
Download
teaches the essentials of the language. Part II,“The Foundation Framework,” teaches how
to use the rich assortment of predefined classes that form the Foundation framework. Part
III,“Cocoa Programming and the iPhone SDK,” gives you an overview of Cocoa’s Application
Kit framework and then walks you through the process of developing a simple
iPhone application using the UIKit framework, and developing and debugging the code
with Xcode and Interface Builder.
A framework is a set of classes and routines that have been logically grouped together to
make developing programs easier. Much of the power of programming in Objective-C
rests on the extensive frameworks that are available.
Chapter 2,“Programming in Objective-C,” begins by teaching you how to write your
first program in Objective-C.
Because this is not a book on Cocoa programming, graphical user interfaces (GUIs)
are not extensively taught and are hardly even mentioned until Part III. So an approach
was needed to get input into a program and produce output. Most of the examples in this
text take input from the keyboard and produce their output in a window: a Terminal
window if you’re using gcc from the command line, or a Console window if you’re using
Xcode.
Chapter 3,“Classes, Objects, and Methods,” covers the fundamentals of object-oriented
programming.This chapter introduces some terminology, but it’s kept to a minimum.
I also introduce the mechanism for defining a class and the means for sending
messages to instances or objects. Instructors and seasoned Objective-C programmers will
notice that I use static typing for declaring objects. I think this is the best way for the student
to get started because the compiler can catch more errors, making the programs
more self-documenting and encouraging the new programmer to explicitly declare the
data types when they are known.As a result, the notion of the id type and its power is not
fully explored until Chapter 9,“Polymorphism, Dynamic Typing, and Dynamic Binding.”
Chapter 4,“Data Types and Expressions,” describes the basic Objective-C data types
and how to use them in your programs.
Chapter 5,“Program Looping,” introduces the three looping statements you can use in
your programs: for, while, and do.
Making decisions is fundamental to any computer programming language. Chapter 6,
“Making Decisions,” covers the Objective-C language’s if and switch statements in detail.
Chapter 7,“More on Classes,” delves more deeply into working with classes and objects.
Details about methods,multiple arguments to methods, and local variables are discussed
here.
Chapter 8,“Inheritance,” introduces the key concept of inheritance.This feature makes
the development of programs easier because you can take advantage of what comes from
above. Inheritance and the notion of subclasses make modifying and extending existing
class definitions easy.
Chapter 9 discusses three fundamental characteristics of the Objective-C language.
Polymorphism, dynamic typing, and dynamic binding are the key concepts covered here.
Chapters 10–13 round out the discussion of the Objective-C language, covering issues
such as initialization of objects, protocols, categories, the preprocessor, and some of the
underlying C features, including functions, arrays, structures, and pointers.These underlying
features are often unnecessary (and often best avoided) when first developing objectoriented
applications. It’s recommended that you skim Chapter 13,“Underlying C
Features,” the first time through the text and return to it only as necessary to learn more
about a particular feature of the language.
Part II begins with Chapter 14,“Introduction to the Foundation Framework,” which
gives an introduction to the Foundation framework and how to access its documentation.
Chapters 15–19 cover important features of the Foundation framework.These include
number and string objects, collections, the file system, memory management, and the
process of copying and archiving objects.
By the time you’re done with Part II, you will be able to develop fairly sophisticated
programs in Objective-C that work with the Foundation framework.
Part III starts with Chapter 20,“Introduction to Cocoa.” Here you’ll get a quick
overview of the Application Kit that provides the classes you need to develop sophisticated
graphical applications on the Mac.
Chapter 21,“Writing iPhone Applications,” introduces the iPhone SDK and the UIKit
framework.This chapter illustrates a step-by-step approach to writing a simple iPhone (or
iTouch) application, followed by a calculator application that enables you to use your
iPhone to perform simple arithmetic calculations with fractions.
Because object-oriented parlance involves a fair amount of terminology,Appendix A,
“Glossary,” provides definitions of some common terms.
Appendix B,“Objective-C Language Summary,” gives a summary of the Objective-C
language, for your quick reference.
Appendix C,“Address Book Source Code,” gives the source code listing for two classes
that are developed and used extensively in Part II of this text.These classes define address card and address book classes. Methods enable you to perform simple operations such as
adding and removing address cards from the address book, looking up someone, listing
the contents of the address book, and so on.
After you’ve learned how to write Objective-C programs, you can go in several directions.
You might want to lean more about the underlying C programming language—or
you might want to start writing Cocoa programs to run on Mac OS X, or develop more
sophisticated iPhone applications. In any case,Appendix D,“Resources,” will guide you in the right direction.
Download
Tuesday, July 20, 2010
Build ObjectC on Windows with Foundation frameworks
Use
gcc `gnustep-config --objc-flags` -o hello hello.m -L C:/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base
on Shell command line.
view more
gcc `gnustep-config --objc-flags` -o hello hello.m -L C:/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base
on Shell command line.
view more
Monday, July 19, 2010
iPhone touch motion
View
import flash.events.MouseEvent; |
DisplayUtils and fitIntoRect
Useful to create thumbnails and resizing
From http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle
From http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle
Sunday, July 18, 2010
Slide Transition
View DEMO
How to use:
import binhpro.SlideTransition; |
SlideTransition.as
package binhpro { //binhpro.SlideTransition |
ClickPageEvent.as
package binhpro { //binhpro.ClickPageEvent |
ImageUtils.as
package binhpro.utils { // binhpro.utils.ImageUtils |
Friday, July 16, 2010
Grid of Items Container
This post introduces to you a container that can help you create a grid of items that list in horizontal or vertical direction.
You can customize the ItemRenderer and ScrollBar by passing the name of it's Linkage Class.
HORIZONTAL CANVAS:
VIEW
VERTICAL CANVAS:
VIEW
EXAMPLE CODE:
Checkout SVN: https://flashtraining.googlecode.com/svn/trunk/AS3/BDCFramework
You can customize the ItemRenderer and ScrollBar by passing the name of it's Linkage Class.
HORIZONTAL CANVAS:
VIEW
VERTICAL CANVAS:
VIEW
EXAMPLE CODE:
import binhdocco.containers.canvas.Canvas; |
Checkout SVN: https://flashtraining.googlecode.com/svn/trunk/AS3/BDCFramework
Wednesday, July 14, 2010
Testing local or online
AS3 |
From Snipplr
Tuesday, July 13, 2010
Access the _root (AS2) in AS3
In AS2, we can use _root to access the first level movie.
In AS3, we use
In AS3, we use
(stage.getChildAt(0) as MovieClip) |
Useful Flash MXP Tool
This tool help you design faster, with 5 figures below:
1.MouseEvent: auto generate Click, RollOver, RollOut code for selected instance.
2.Reflection: auto generate a reflection of selected instance, a selected instance must has registration point at Top-Left, and does not be scaled, please scale its children if you want to make it larger.
3. Clean library: make the library clean, automatic does arrange movies into Movies folder, buttons to Buttons folder, ...
4. Object to movie-button: does create a movie-button of selected object in stage, such as text, shape, image. Frame 1 is normal state, frame 2 is roll-over state.
5. Create transparent movie-button: does create a transparent movie-button and add it into your stage, it is useful to cover the 'popup movie', don't allow users click through the behind interactive objects.
Supported IDE: Flash CS3, CS4, CS5, with AS2 and AS3.
Download here
1.MouseEvent: auto generate Click, RollOver, RollOut code for selected instance.
2.Reflection: auto generate a reflection of selected instance, a selected instance must has registration point at Top-Left, and does not be scaled, please scale its children if you want to make it larger.
3. Clean library: make the library clean, automatic does arrange movies into Movies folder, buttons to Buttons folder, ...
4. Object to movie-button: does create a movie-button of selected object in stage, such as text, shape, image. Frame 1 is normal state, frame 2 is roll-over state.
5. Create transparent movie-button: does create a transparent movie-button and add it into your stage, it is useful to cover the 'popup movie', don't allow users click through the behind interactive objects.
Supported IDE: Flash CS3, CS4, CS5, with AS2 and AS3.
Download here
Monday, July 12, 2010
Easy mouse panning
Make the movie panning with moving mouse.
Example:
View
Source code:
Code on the thumbnail map:
Example:
View
Source code:
|
Code on the thumbnail map:
this.addEventListener(Event.ENTER_FRAME, onEF); |
Subscribe to:
Posts (Atom)