Dynamic keyword

Dynamic keyword

hi.......
What is the dynamic keyword used for in flex?

give me the answer ASAP

Thanks
View Answers

October 15, 2010 at 12:02 PM

Ans: Dynamic keyword-> Specifies that instances of a class may possess dynamic properties added at run time.
For example: In Java, if you?ve created an object from a particular class, you can use only properties and methods that were defined in this class. For example, if the following class:

class Product{
String name;
}

you can only manipulate with the name property:

Product p = new Product();
p.name = ?colddrink?;
System.out.println(p.name);

ActionScript dynamic classes, which allow you to programmatically add new properties and behavior to classes during the run-time. Just add the magic keyword dynamic to the class definition:

dynamic class Product{
var name:String;
}

Now let?s add dynamically two variables name and price and the function printme() to the object of type Person:

Person p= new Person();
p.name=?colddrink?;
p.price=12;
p.printMe = function () {
trace (p.name, p.price);
}
p.printMe(); // colddrink 12









Related Tutorials/Questions & Answers:
Dynamic keyword
Dynamic keyword  hi....... What is the dynamic keyword used for in flex? give me the answer ASAP Thanks  Ans: Dynamic keyword... during the run-time. Just add the magic keyword dynamic to the class definition
What is this keyword?
What is this keyword?  What is this keyword
Advertisements
Keyword - this
Keyword - this       A keyword is a word having a particular meaning to the programming language. Similarly, this keyword is used to represent an object constructed from a class
Java keyword
Java keyword  Is sizeof a keyword
The if Keyword
The if Keyword         The if is a keyword, which is used to perform the selection... that are executed in case, the test condition specified by the if keyword evaluates
super keyword
super keyword  super keyword explain
final keyword
final keyword  why is final keyword used in java
The for Keyword
The for Keyword       The for is Java keyword that is used to execute a block of code... increments the value of i by one.ADS_TO_REPLACE_5 The for keyword may not be used
transient keyword
transient keyword  how to use transient keyword?   Hi Friend, The transient keyword is used to indicate that the member variable should not be serialized when the class instance containing that transient variable
Return keyword
Return keyword  how do we use return in methods?   Java use of return keyword import java.util.*; public class ReverseString{ public... at Return Keyword
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
static keyword
static keyword  please give some detail about Static keyword.   Static Variables Static variables are class variables that are shared by all instance of class .. 1)It is a variable which belongs to the class
SQL as Keyword
SQL as Keyword       The SQL Key word used in SQL are createTable,Insert into,select,delete... use various keywords like, create table keyword is used to create a table
static keyword with real example
static keyword with real example  static keyword with real examplestrong text
The final Keyword
The final Keyword       The final is a keyword. This is similar to const keyword in other languages. This keyword may not be used as identifiers i.e. you cannot declare
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp
this java keyword
this java keyword       "this" is a keyword defined in the java programming language. Keywords... in java programming language likewise the this keyword indicates the following
transient keyword - Java Beginners
transient keyword  what is transient keyword in java.? plz explain with example
why using static keyword
why using static keyword  why using static keyword
dynamic polymorphism
dynamic polymorphism  Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle, Ellipse, Triangle, Polygon, etc. Design a simple test application to demonstrate dynamic polymorphism
The void keyword
The void keyword       The void is a keyword defined in the java programming language. Keywords... programming language likewise the void keyword indicates the following
The While keyword
The While keyword       While is a keyword defined in the java programming language. Keywords... programming language likewise the while keyword indicates the following
The volatile keyword
The volatile keyword       The volatile is a keyword defined in the java programming language. Keywords.... The volatile keyword is mostly used to indicate that a member variable
dynamic jquery statement
dynamic jquery statement  dynamic jquery statement
static keyword in interface
static keyword in interface  Could any one explain,why static keyword implict (or explict ) come in interface? I asked lot of persons about this question, but nobody did not answered clearly. please explain clearly and say what
The extends keyword
The extends keyword In this section you will learn about extends keyword in java. The extends is a keyword in java which is used in inheritance. It is used to specify super class in a class declaration. Using this keyword a subclass
dynamic polymorphism
dynamic polymorphism  give an example for dynamic polymorphism?   Dynamic polymorphism is where a class overrides a superclass method... seen at runtime, so they are considered dynamic. Here is an example
The extends Keyword
The extends Keyword       The extends is a Java keyword, which is used in inheritance process of Java. It specifies the superclass in a class declaration using extends keyword
PHP Dynamic CheckBox
PHP Dynamic CheckBox  Help with Dynamic Checkbox in PHP
php dynamic array checking
php dynamic array checking  php dynamic array checking
php dynamic array checking
php dynamic array checking  php dynamic array checking
create dynamic array in javascript
create dynamic array in javascript  How to create dynamic array in javascript
Super - keyword
Super - keyword       super keyword super is a keyword in java that plays an important role in case of inheritance. Super keyword is used to access the members of the super class. Java
dynamic textfields
dynamic textfields  Hi, I am a fresher and joined recently in one company. they gave me a desktop application project using swings.here is my detailed spec Screen 1 - The user enters the ingredients from a food product, saves
The byte Keyword
The byte Keyword       The byte Java Keyword defines the 8-bit integer primitive type.  The keyword byte in Java is a primitive type that designates with eight bit signed
Dynamic form
Dynamic form  I need to make a dynamic form using jsp for example, i will need a list of items which when we select one option another list is modified ( like 2 lists of countries and citys ), and also a radio button wich once
ModuleNotFoundError: No module named 'extract-keyword'
ModuleNotFoundError: No module named 'extract-keyword'  Hi, My... named 'extract-keyword' How to remove the ModuleNotFoundError: No module named 'extract-keyword' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'micropython-keyword'
ModuleNotFoundError: No module named 'micropython-keyword'  Hi, My... named 'micropython-keyword' How to remove the ModuleNotFoundError: No module named 'micropython-keyword' error? Thanks   Hi
ModuleNotFoundError: No module named 'pycopy-keyword'
ModuleNotFoundError: No module named 'pycopy-keyword'  Hi, My... named 'pycopy-keyword' How to remove the ModuleNotFoundError: No module named 'pycopy-keyword' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cubicweb-keyword'
ModuleNotFoundError: No module named 'cubicweb-keyword'  Hi, My... named 'cubicweb-keyword' How to remove the ModuleNotFoundError: No module named 'cubicweb-keyword' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'extract-keyword'
ModuleNotFoundError: No module named 'extract-keyword'  Hi, My... named 'extract-keyword' How to remove the ModuleNotFoundError: No module named 'extract-keyword' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keyword_density'
ModuleNotFoundError: No module named 'keyword_density'  Hi, My... named 'keyword_density' How to remove the ModuleNotFoundError: No module named 'keyword_density' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keyword-ranker'
ModuleNotFoundError: No module named 'keyword-ranker'  Hi, My... named 'keyword-ranker' How to remove the ModuleNotFoundError: No module named 'keyword-ranker' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keyword-tree'
ModuleNotFoundError: No module named 'keyword-tree'  Hi, My Python... 'keyword-tree' How to remove the ModuleNotFoundError: No module named 'keyword-tree' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keyword_xtract'
ModuleNotFoundError: No module named 'keyword_xtract'  Hi, My... named 'keyword_xtract' How to remove the ModuleNotFoundError: No module named 'keyword_xtract' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keyword-zjuzx'
ModuleNotFoundError: No module named 'keyword-zjuzx'  Hi, My... 'keyword-zjuzx' How to remove the ModuleNotFoundError: No module named 'keyword-zjuzx' error? Thanks   Hi, In your python
dynamic form
dynamic form  I need to make a dynamic form using php, for example, i will need a list of items which when we select one option another list is modified ( like 2 lists of countries and citys from a dtabase ), and also a radio
The boolean Keyword
The boolean Keyword       The boolean Keyword in java avails one of the two values that are true and false. Java have the boolean type so literal values true and false. 
true Java Keyword
true Java Keyword       The true is a keyword defined in the java programming language. Keywords... in java programming language likewise the true keyword indicates the following
dynamic calender
dynamic calender  hi i need the code to "insert date using GUI"   Hi Friend, Try the following code:ADS_TO_REPLACE_1 import java.awt.*; import java.awt.event.*; import javax.swing.*; class DatePicker{ int month

Ads