Is Using Static functions advisable from performance(speed) point of view
I was wondering if using a static function would be slower than using a normal function, especially when the function is to be accessed by multiple threads since the same memory area is used each time the static function is accessed from any of the threads. Thus is it right if I say that static functions are not suitable for multiThreaded access ?
I was wondering if using a static function would be
slower than using a normal function,Static functions are linked at compile time, while normal functions have to be linked based on the runtime type of the object they are called on. This lookup means that static function invocations are likely to be faster.
especially when
the function is to be accessed by multiple threads
since the same memory area is used each time the
static function is accessed from any of the threads.If you are talking about the code segment, where the function definition is held, there is only a single copy of each "normal" function as well. The code segment is also read-only, so there are no issues with multiple threads reading and executing the same code at the same time.
There are the normal issues with multi-threaded access to variables in static functions that exist with normal functions.
Thus is it right if I say that static functions are
not suitable for multiThreaded access ?Static functions are no safer than non-static functions in terms of thread safety. On the other hand, it is no more dangerous having multiple threads calling a static function than having multiple threads calling a non-static function on the same object. Exactly the same thread safety techniques apply whether you are working in a static or a non-static context.
With the above in mind, there is a great deal of design difference between static functions and non-static functions. They mean very different things when creating a system, and an operation that is suited for a static function is very likely not appropriate in a non-static context, and vice versa. The important thing is to make sure the design is appropriate for what the system is trying to do.
The most common use of static functions is for object creation... The Factory design pattern uses static methods to create objects of a given type, the Singleton design pattern uses static methods to allow access to itself.
Similar Messages
-
JMS - Useful from an international point of view?
Hi everyone,
I was wondering if JMS could be useful from a legislative point of view. I mean could it be useful when two companies situated in different countries communicate? Does JMS make this communication easier/better in any way?
Hope someone is able to help me :)JMS is ideal for the loosely coupled communications which the integration of two different companies or governments would require. However, message oriented middleware has typically been a behind-the-firewall technology. So, while most JMS vendors support messaging over the firewall, it is not their primary focus. Web services are better suited to the type of over-the-Internet integration you are describing. The issue with this, however, is that web services lack transactional support. I think they are working on that though.
-
Improving audio quality from a subscriber point of view
Hi,
I am building an application that requires audio chat. When the chat is happening between an Android user and a PC user, the PC user can hear clearly when the Android user speaks. However, when it is the other way around, the Android user hear distorted sound,with noises. Is there any way to improve audio received from a subscriber point of view?
Please advice, thanks!
RegardsHi Raff,
The Android device is a Samsung Galaxy S i9000 and it is running AIR 2.6, attached below is a snippet of the code related to the audio i am using
<mx:Button x="121" y="700" height="34" width="117" label="Audio" toggle="true" id="audioButt"
click="(audioButt.selected) ? audioPub.publish(): audioPub.stop()" includeIn="LoggedIn"/>
<mx:Button x="242" y="700" height="34" width="117" label="Quality" toggle="true" id="audioButt1" includeIn="LoggedIn"
click="(audioButt.selected) ? audioPub.microphoneManager.encodeQuality = 3 : audioPub.microphoneManager.encodeQuality = 4"/>
<rtc:AudioPublisher id="audioPub" codec="{SoundCodec.SPEEX}" useEchoSuppression="true" silenceLevel="0" />
<rtc:AudioSubscriber/>
I think the problem is related to the script I am writing,I created a button called Quality to reduce the encodeQuality of my PC microphone, will it helps to improve the audio recieved from my Android device?Please advice, thanks!
Regards -
Responce times from end-user point of view
Hi,
I am looking for the way how to collect responce times from end-user point of view.
Logging of function execution via DMS is not enogh thus we need to discover and monitor problems in all components including poor network, users terminals etc.
Regards,
TomaszHi,
I am looking for the way how to collect responce times from end-user point of view.
Logging of function execution via DMS is not enogh thus we need to discover and monitor problems in all components including poor network, users terminals etc.
Regards,
Tomasz -
Handling Unit Information from sap mm point of view
Hi all.
Looking for Handling Unit Information from sap mm point of view.
Regards.
Parameshwar
Note : Please search forum before posting.
Edited by: Jeyakanthan A on Sep 22, 2011 1:20 PMPlease refer the below links
http://help.sap.com/printdocu/core/print46c/en/data/pdf/LOHU/LOHU.pdf
http://help.sap.com/bp_bblibrary/600/html/G74_BB_EN_US.htm -
Lost message from server's point of view
Hi All
Following situation:
The JMS-Provider sends a JMS-Message. The message is entirely in the wire and is still flying to the consumer. Before the message arrives to the consumer, the network connection fails, so the client does nothing know about the send message.
From the server’s point of view the message was successfully sent but not acknowledged yet. The server waits for an acknowledge and doesn’t undertake redelivery, because the consumer session on the server is still living.
From the consumer point of view the message was not sent so the client has nothing to ack, so we have some “deadlock”.
The question is – how does server recognize such situation (short connection fail, deadlock) and what does it undertake to guarantee the delivery?
Thank you.The JMS-Provider sends a JMS-Message. The message is entirely in the wire and is still flying to the consumer. Before the message arrives to the consumer, the network connection fails, so the client does nothing know about the send message.
From the server’s point of view the message was successfully sent but not acknowledged yet. The server waits for an acknowledge and doesn’t undertake redelivery, because the consumer session on the server is still living.
From the consumer point of view the message was not sent so the client has nothing to ack, so we have some “deadlock”.
The question is – how does server recognize such situation (short connection fail, deadlock) and what does it undertake to guarantee the delivery?If the "network connection fails" whilst sending a message then the server (and probably the client) will almost certainly receive a SocketException. A message is unlikely to simply disappear on the wire without at least one end of the socket getting an exception of some kind, and if the socket is simply hanging for some reason then most JMS providers would have a means to detect this (e.g. by sending periodic packets down the wire to check it is still alive).
But ultimately, if a persistent message is sent to a consuming client and the message is not acknowledged (or the transaction committed) then the server will eventually redeliver it. JMS doesn't define exactly when an unacknowledged message is redelivered, but it typically wouldn't happen until the consumer in question has closed.
Nigel -
Levels of planning from sap mm point of view
Hi All.
Need Information On Levels of planning from sap mm point of view.
Thanks in advance all sap mm forum guys
Regards.
Parameshwar.Please check
[MRP Areas|http://help.sap.com/saphelp_46c/helpdata/EN/c4/106956ae8a11d1a6720000e83235d4/frameset.htm]
[http://help.sap.com/saphelp_46c/helpdata/EN/c4/106956ae8a11d1a6720000e83235d4/frameset.htm] -
Using static function in c++
Hi,
I'm using an static function on C++ program, as :
static int lRead(char ptr, Socket pSock);
but when I compiled recived the following error:
Error: "static" is not allowed here.
any idea about how do i need to set static functions and variables?
regards,You really should provide more information, but the statement looks fine. Probably, you've got a syntax error earlier in the translation unit, possibly in an include file.
... Dave -
OIF-What's the diff. from user's point of view of SP/IdP initiated SSO
I'm using OIF for federated single sign on. I got both the SP and IdP initiated SSO works. When I provide both URL to customer, how should I suggest which one to use? from end user's point of view, both of them works in the similar work flow: type(click) URL -> redirect to IdP's login page -> login -> return back to application. only diff. seems the URL. most of user even did not notice the diffrence between 2 URLs.
Could some give some suggestion when and which one is preferred.
ThanksProbabaly. however, in our case, the application url, e.g. http://appurl is used for non-federate sign on. so that the applicaiton can be run independent of IdP, e.g. IdP down.
To allow federate sign on, we use one of following (as documented in OIF admin guide):
SP initiated:
http://SP host:port/ fed/sp/initiatesso?providerid=<SP provider Id>& returnurl=<http://appurl>
IdP initiated:
http://IdP host:port/fed/idp/initiatesso?providerid =<IdP provider Id>& returnurl=<http://appurl>
So, you can see these does not support bookmark of federate sso since they would return back to http://appurl after federate sign on.
Any suggestion? we couldn't tell good diffrence about above urls to our customer. is there anyway to allow us enable bookmark the federated sso?
Thanks -
"Call Library Function" absent from performance profiling
Hello,
I'm trying to optimize my VI execution time by using the "Profile Performance and Memory" window.
The VI takes 25 sec to run, however the profiler reports something like 25 ms, if I understand correctly.
I know the 25 sec includes all other processes on the CPU. However I highly suspect a lot of time is spent in 3rd party DLL functions I use, which read and write files, among other things.
The problem is that the "Call Library Function" nodes do not appear in the profiler window at all! My questions:
1) Why don't clf nodes appear?
2) Is there some way to inspect the time spent in the DLL functions?
Note: There is a related (unanswered) post from 2009 here: http://forums.ni.com/t5/LabVIEW/Profile-performance-of-a-VI-using-DLL/m-p/888833#M401525
Thanks
Itay.I recommend taking the simple approach - put a millisecond timer function before and after the call to the DLL, and subtract. I suspect that CLFNs do not appear in the profiler because LabVIEW hands off execution to the DLL and can't monitor the internals of what the DLL is doing. LabVIEW has no way to know how much memory the DLL allocates nor how much processor time the DLL uses.
-
Call to a possibly undefined method displays when using static function in Unit Test
Hello!
This has been driving me nuts. I am setting up unit tests for a static class which manages a collection of songs. This is how my unit test class looks:
//START CODE
package flexUnitTests {
import com.myapp.managers.MusicManager;
import flash.utils.Dictionary;
import flexunit.framework.Assert;
public class MyAppManagerTest {
[Before]
public function setUp():void {
var songData:Dictionary = new Dictionary();
songData["mn0012345"] = new Dictionary();
songData["mn0012345"]["title"] = "All the Pretty Little Horses";
songData["mn0012345"]["description"] = "by: American Traditional | Voice, Piano | 3 pages";
MusicManager.setSongData(songData);
[Test]
public function test_getAuthorsBySKU():void {
var expected:String = "American Traditional";
var given:String = MusicManager.getAuthorsBySKU("mn0012345");
Assert.assertEquals(expected, given);
//END OF CODE
You will notice two calls in red above. When I leave them in the code I see a variety of errors which look like this:
"Call to a possibly undefined method '' through a reference with a static type com.myapp..."
And
"Access of possible undefined property '' through a reference with static type com.myapp..."
Then, when I comment out the two lines in red above, these errors go away. Flash Builder seems really flakey to me. Often I notice that the error list varies, how can it just no longer be an error? Where did this new access error come from, in a no related part of the code, by adding or removing a function call to a static class which remains in the import statement.
Note that the MusicManager contains no references to any of the UI mxml that is throwing these errors. It just simply loads data into a few globals and allows you to grab info.
How is my usage of this function making foreign objects inaccessible?
Please help!!! I am really hoping there is an answer but I have a bad feeling the answer is just that Flash Builder is flakey.I did some more work on the issue above. There are functions with in the MusicManager that call the UserManager to get a user's ID. When I comment out these calls then the access errors go away. Well the user manager has some calls back to mxml that tell the class that changes where made. My best guess is this is where it stems into the code that is randomly throwing errors. But, it compiles fine and runs fine on a device. Is there something with test cases which doesn't invoke the UI?
-
Executing a BDC Session using a Function Module from a Custom Z-Report
Hello,
I have a requirement where I need to Create a BDC Session for the given Transaction Code. But instead of executing the Session from SM35 manually, I need to Execute the Session Immediately from my Custom Z-Report itself.
Is there any Function Module for this Activity? Please let me know.
Thanks and Regards,
Venkata Phani Prasad K1) fm job_open
2) submit report
3) fm job_close
4) finally select table TBTCO
example:
DATA: jobcount_test LIKE tbtcjob-jobcount,
job_released LIKE btch0000-char1,
rcode(2),
strtimmed LIKE btch0000-char1 VALUE 'X'.
DATA jobname LIKE tbtcjob-jobname.
CONCATENATE 'TEST_' sy-repid '_' sy-datum INTO jobname.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount_test
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE x000(yp) WITH 'JOB-START ' jobname ' failed !!!'.
ELSE.
*--Step insert
SUBMIT rsbdcsub
USER sy-uname VIA JOB jobname NUMBER jobcount_test
WITH mappe = map
WITH von = pdatum
WITH z_verarb = 'X'
AND RETURN .
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount_test
jobname = jobname
strtimmed = strtimmed
targetsystem = sy-host
IMPORTING
job_was_released = job_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc > 1.
MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.
ENDIF.
ENDIF. -
Transaction codes from end user point of view
hi all,
I am expecting end user transaction codes of warehouse management.
I am familiar with materials management but looking to learn WM.
regards,
nitin patilHi refer bellow Tcodes,
WM
0.LI21 - Clear the stock from inventory
1.LB01 - Create Transfer Requirement
2.LB02 - Change transfer requirement
3.LB03 - Display Transfer Requirement
4.LB10 - TRs for Storage Type
5.LB11 - TRs for Material
6.LB12 - TRs and Posting Change for MLEat.Doc.
7.LB13 - TRs for Requirement
8.LD10 - Clear decentralized inventory difference
9.LD11 - Clear differences for decentral.sys.
10.LI01 - Create System Inventory Record
11.LI02 - Change System Inventory Record
12.LI03 - Display System Inventory Record
13.LI04 - Print System Inventory Record
14.LI05 - Inventory History for Storage Bin
15.LI06 - Block Storage types for annual invent.
16.LI11 - Enter Inventory Count
17.LI12 - Change inventory count
18.LI13 - Display Inventory Count
19.LI14 - Start Inventory Recount
20.LI20 - Clear Inventory Differences WM
21.LI21 - Clear Inventory Differences in MM-IM
22.LL01 - Warehouse Activity Monitor
23.LLVS - WM Menu
24.LN01 - Number Ranges for Transfer Requirement
25.LN02 - Number Ranges for Transfer Orders
26.LN03 - Number Ranges for Quants
27.LN04 - Number Ranges for Posting Changes
28.LN05 - Number Ranges for Inventory
29.LN06 - Number Ranges for Reference Number
30.LN08 - Number Range Maintenance: LVS_LENUM
31.LP10 - Direct picking for PO
32.LP11 - WM staging of crate parts WM运
33.LP12 - Staging release order parts (WM-PP)
34.LP21 - WM replenishment for fixed bins WM
35.LP22 - Replenishment Planning for Fixed Bins
36.LQ01 - Transfer Posting in Invent. Mgmt
37.LQ02 - Transfer Posting in Invent. Mgmt
38.LS01 - Create Warehouse Master Record
39.LS02 - Change Warehouse Master Record
40.LS03 - Display Warehouse Master Record
41.LS04 - Display Empty Storage Bins
42.LS05 - Generate Storage Bins
43.LS06 - Block Storage Bins
44.LS07 - Block Quants
45.LS08 - Block Storage Bins per Aisle
46.LS09 - Display Material Data for Storage Type
47.LS11 - Change storage bins (multiple proc.)
48.LS12 - Block Storage type
49.LS22 - Change Quants
50.LS23 - Display Quants
51.LS24 - Display Quants for Material
52.LS25 - Display Quants per Storage Bin
53.LS26 - Stock of Material
54.LS27 - Display Quants for storage unit
55.LS28 - Display storage units / bin
56.LS32 - Change storage unit
57.LS33 - Display storage unit
58.LS41 - List of control cycles for WIP loc
59.LT01 - Create Transfer Order
60.LT02 - Create TO for Inventory Difference
61.LT03 - Create TO from Delivery Note
62.LT04 - Create TO from TR
63.LT05 - Process Posting Change Notice
64.LT06 - Create TO for Material Document
65.LT07 - Create TO for mixed storage unit
66.LT08 - Manual addition to storage unit
67.LT09 - ID point function for storage units
68.LT0A - Pre-plan storage units
69.LT0B - Stock Placement of Shipping Units
70.LT0C - Stock Removal of Shipping Units
71.LT0D - Stock Transfer of Shipping Units
72.LT0E - Create Removal TO for 2-Step Picking
73.LT10 - Create Transfer Order from List
74.LT11 - Confirm Transfer Order Item
75.LT12 - Confirm Transfer Order
76.LT13 - Confirm TO for storage unit
77.LT14 - Confirm preplanned TO item
78.LT15 - Canceling transfer order
79.LT16 - Canceling TO for storage unit
80.LT17 - Single Entry of Actual Data
81.LT1A - Change Transfer Order
82.LT21 - Display Transfer Order
83.LT22 - Display Transfer Order / Storage Type
84.LT23 - Display Transfer Orders by Numbers
85.LT24 - Display Transfer Order / Material
86.LT25 - Display Transfer Order / Reference
87.LT26 - Transfer orders for storage bin
88.LT27 - Transfer order for storage unit
89.LT28 - Display Transfer Order / Reference
90.LT31 - Print TO Manually
91.LT32 - Print transfer order for storageunit
92.LT41 - Prepare TRs for Multiple Processing
93.LT42 - Create TOs by Multiple Processing
94.LT43 - Forming groups for deliveries
95.LT44 - Release for Multiple Processing
96.LT45 - Evaluation of reference numbers
97.LT51 - Maintain Missing Stock
98.LT63 - Control: Single Entry of Actual Data
99.LT64 - Single Entry of Actual Data
100.LT72 - Determine 2-step relevance
101.LT73 - Display 2-step
102.LU01 - Create Posting Change Notice
103.LU02 - Change Posting Change Notice
104.LU03 - Display Posting Change Notice
105.LU04 - Selection of Posting Change Notices
106.LX01 - List of Empty Storage Bins
107.LX02 - Inventory List
108.LX03 - Bin Status Report
109.LX04 - Capacity Used
110.LX05 - Block Bins in Bl.Storage w .Time Limt
111.LX06 - Inventory List for Fire Department
112.LX07 - Check storage
113.LX08 - Accident Regulations List
114.LX09 - Overview of All Transfer Requirements
115.LX10 - Activities per Storage Type
116.LX11 - Overview of Documents
117.LX12 - Document Overview: Landscape Format
118.LX13 - Analysis of Differences
119.LX14 - Analysis of Material Transfers
120.LX15 - Selection of Bins for Annual Inventory
121.LX16 - Selection of Bins for Continuous Inventory
122.LX17 - List of Inventory Differences
123.LX18 - Statistics of Inventory Differences
124.LX19 - Inventory Data Takeover by Batch Inp.
125.LX20 - Generate interim storage bins
126.LX21 - Pick List for Several Transfer Order
127.LX22 - Process Inventory from Overview
128.LX23 - Stock comparison IM - WM
129.LX24 - Display of Hazardous Material numbers
130.LX25 - Inventory Status
131.LX26 - Inventory in WM via cycle counting
132.LX27 - Stock levels by shelf life expiry date
133.LX28 - Relevant TO item for ext.system
134.LX29 - Fixed bin supervision
135.LX30 - Overview of WM messages ext.system
136.LX31 - Analysis of print control tables
137.LX32 - Archived transfer orders
138.LX33 - Archived transfer requirements
139.LX34 - Archived posting change notices
140.LX35 - Archived system inventory records
141.LX36 - Archived inventory histories
142.LX37 - Linked objects
143.LX38 - Check Report Customizing Strategy K
144.LX39 - Evaluation Reference No. for 2-S.Pck
145.LX40 - Material Situation Prod. Storage Bin
146.LX41 - Bin Status Report WM/PP Interface
147.LX42 - Evaluation PP Order from WM View
148.LX43 - Consistency Check for Control Cycles MCL9
WM: Material Plcmt/Removal:Selection
149.MCLD - WM: Material flow - Selection
150.MCLH - WM: Movement types - selection -
151.OL01 - Display / change LDK34 (bins)
152.OL02 - Display / change RLPLA (bins)
153.OL03 - Display / change LDK33 (stock)
154.OL04 - Display / change RLBES (stock)
155.OL05 - Display / change LDK30 (mat.whse)
156.OL06 - Display / change LDK31 (mat.type)
157.OL07 - Data transfer stor.bins LDK34->RLPLA
158.OL08 - Data transfer stor.bins RLPLA->B.I.
159.OL09 - Data transfer stor.bins LDK34->LAGP
160.OL10 - Test storage bin data transfer
161.OL11 - Data transfer stock LDK33->RLBES
162.OL12 - Data transfer stock RLBES-> B.I.
163.OL13 - Data transfer stock LDK33->LQUA
164.OL14 - Test stock data transfer
165.OL15 - Data transfer material whse no.view
166.OL16 - Test mat.master data transfer (MLGN)
167.OL17 - Data transfer material storage type
168.OL18 - Test mat.master data transfer (MLGT)
169.OLVS C SD Menu for Master Data
170.VM01 - Create Hazardous Material
171.VM02 - Change Hazardous Material
172.VM03 - Display Hazardous Material
WM-DWM
Decentralized Warehouse Management
1.DZ00 - Introduction to Decentralized Systems
2.LD01 - Repost Communication Document
3.LD02 - Reposting multiple comm.records
4.LD03 - Display Communication Document
5.LD04 - Evaluation of Communication Doc
6.LD05 - Check LDK01 Records (internal call)
7.LD06 - Check LDK02 Records
8.LD07 - Check LDK03 Records
9.LD08 - Check LDK04 Records (internal call)
10.LD09 - Check LDK05 records
11.LN07 - Number Ranges for WM Communic.Rec. -
Exch 2013 Installation and configuration from a SBS point of view?
I was just wondering if anyone has stumbled upon any good "how-to" sites for those of us that (up to now) have been used to using SBS servers but now find ourselves needing to go the manual route with separate new servers (domain controller and
Exchange 2013 server)?
I'm trudging along with my first Server 2012 R2 and Exchange 2013 SP1 installation and configuration, but since I'm used to things configuring themselves in SBS, the piecemeal approach to 2013 is presenting challenges for me.
Considering the market for SBS is small business (and for me, typical 20 users), I'm looking for some direction and help in configuring these new servers to act like SBS 2011 replacement servers, with similar capabilites, etc...from the viewpoint of an SBS
administrator, per se.
Maybe nothing exists and we have to start from scratch, but I was hoping with as big as the SBS market was, there would be some useful info out there with the realization that we're coming from SBS.
Thanks.Hello,
It seems you have installed the Exchange Server and preparing to move mailboxes to the new host. You can check the application log to check whether the new installed Exchange works
fine.
If there are any error ID/reports, you can post them here for our referernce.
Thanks,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Simon Wu
TechNet Community Support -
Class theory from a designers point of view
Short history of me. I have been using flash since version 3 as a designer. There you go, right onto the question!
I want to know how to make an object that I have manually placed on the stage from the library with a Class attached to it, interact with the Document Class?
So I am basically dragging the item onto the stage and this item has a class attached and the Document Class with all of its SubClasses needs to know this exists.
Now I was dabbling with making geometry wars to learn AS3 Classes and it was great fun, I set up the Document Class, my enemies and Player 1 Spaceship. I worked out my different SubClasses, and everything was added to the stage by AddChild() along with all SubClasses being created through the Document Class....
Every Class Object was linked to the Document Class as everything was created either by it or through SubClasses under it. So I had full control to do what I wanted. However, all I ever see are elements generated dynamically to the stage. As a designer I want to animate things here and there and then at specific times possibly gain control of this item with it's Class attached, but I want the Document to have a link to this Item.
Also can everybody please stop generating text boxes dynamically all of the time. just create a MovieClip with the form elements on it if it's a form that isnt going to change in layout at all. But this leads onto the same sort of questions, the items arent being created and added to the stage as objects so you still have to make the MovieClip Class understand the items under it exist, I would do it by the Instance Name but is this dirty these days in AS3...
Does any of this make sense? :-S am I asking questions that are maybe puzzling other designers looking at AS3 Code?
Cheers you lot :-)No one is forcing you to place things on the stage. Everything can be done from code and it will all be really neat and tidy and clean. If that is how you want to roll.
But I think you are really making a false dichotomy between AS2 and AS3. You are more stating the difference between AS1 and AS3. With the exception of assigning the Document class AS2 also greatly supports separating you classes, OOP, reusing code, etc. Just not quite to the level of AS3. It is more a difference of degree, not kind.
I think the dichotomy you are feeling is the difference between Flash, which has a rich heritage as a visually creative tool, and some other programming languages which don't.
In AS2, with the aforementioned lack of a Document class, within your linked classes (that extended MovieClip) you could easily place something on the timeline and then reference it in your code the same way as Kglad has shown here. Pretty similar to AS3. Or you could go to a little more trouble and generate them using code.
But the trouble is the issue. Somethings are just a little too difficult to do with code or even if they can be the nuance and feeling of a good animation is often very hard to capture with code. And the ability to update some visual things is very difficult with code. So let's take an example from my world.
Suppose you are making an e-learning game, a drag and drop type activity. The user needs to drag some items arranged in a sort of frame around the outside of the screen into the center of the screen. Now also suppose that the items sort of start in the middle of the screen and explode/move to the outside edge.
The beauty of Flash is that you can just plop those DragClip instances on the stage, tween them around, and visually organize how they should look. Takes, what, maybe a 2 minutes. Doing that it code and refining it could easily take a day.
Then a year later the instructional designer comes and says, "We are making some updates but switch these three drags positions, delete this one, add these 2 new ones and make the placing animation take 2 seconds longer." Again, the fix is just a couple of minutes. But reviewing the code and if it wasn't made perfectly extensible...well I wouldn't want to be doing that.
So all in all I would say it is just another tool and you should use it when it makes sense and not use it when it doesn't.
BTW, the document class will by default declare all placed clips for itself so that is how you can reference them as kglad showed. I like using that feature because I don't have to go in and declare everything. But I usually do it anyways. At the top of my document (or otherwise) class I usually do this:
// Stage placed assets
var drag1:DragClip;
var myButton:MovieClip;
var andSoOn:TextField;
That way I don't get unknown property errors and I (or anyone else who has to update edit my code) can remember what was stage placed when I come back to the file 6 months later.
Maybe you are looking for
-
[JS CS3 Mac&Pc] Enabling automatic localization problem
Hi all, I'm trying to enable automatic localization in my script, as described in 'Localization in ScriptUI Objects' section of 'JavaScript Tools Guide' for CS3 (pages 87-88). I try the first example and it works as expected: $.locale = "fr"; w = new
-
How do i pre order the iphone 5?
how do i pre oerder the iphone 5? and douse the iphone 5 have the same chip slot as the 4?
-
Where is the "Model" In the MVC paradigm of WD4A?
Hi All. I started WD4A around a month back. I have gone through various tutorials. I have never worked before with an MVC paradigm. I can now very well visualize a View and a controller - since these are the terms I read and encounter very often in W
-
I am trying to create a survey form where respondents rate individual factors based on their likelihood, impact, and effectiveness. I need to be able to track the responses based on each factor. For example: Factor Likelihood Impact Effectiveness Fa
-
Why doesnt java work with firefox,i cannot open certain sites
ive been trying to go online auction and it will not bring up the auction