-
so what's the deal with deprecated syntax and this new release???
-
World Kit Vote Holder
Already impatient, eh?
Well, did you see the list of deprecated items from Flash 4 to 5?
<>
and
or
not
ifFrameLoaded
int
random
and all the String functions...
-
it's hard NOT to be impatient
yeah... but i was actually wondering if the new player supports anything coded with older flash4 deprecated coding (jeez... if it doesn't, then lots of people will get pissed)
also, if MX auto-updates the code like 4>5 did
and also if there's anything new on the list of deprecated syntax that we should watch out for
-
curmudgeon
I read a post earlier somewhere by flashguru saying that it is supported for backward compatability
-
[Devil in DarkGreen]
yea.all these code are not supported any more,cause they are garbage code now.
DS
-
WOW demons !!!
i haven't seen you in ages
how's life ???
-
Gross Pecululatarian
The depreciated F4 AS still works in MX.
-
ed
do you know if there's any additions to the deprecated syntax???
also, is it still 'supported' like it is in flash5
for instance, in flash 5 the random() function is deprecated because Math.random() is much more powerful... but i can still use it if i want
do you know if this is still the case?
-
Gross Pecululatarian
The depreciation is the exact same in MX, same things depreciated, still supported. Just the same.
-
Moderator
OK, has anyone run any tests to see if there is a speed difference? (Some of the "depreciated" syntax was faster than the newer F5 methods - is this still the case?
-
Hi CNO,
I guess it still is ... F4 actionscript like random() is compiled into a bytecode at publish time, while a call to Math.random() causes two runtime lookups, one for Math and one for random. These extra lookups form the basis for OO and extensibility, however
Musicman
-
Gross Pecululatarian
And when you say Math.random() it sounds like you know a lot about programming..
-
[Devil in DarkGreen]
hi vivid
i wanna discuss about random
exactly, math.random() is more powerful and speedy then random()
but random() is a useful in attaching movie or for loop
how do u think?
DS
-
Moderator
Originally posted by Musicman
Hi CNO,
I guess it still is ... F4 actionscript like random() is compiled into a bytecode at publish time, while a call to Math.random() causes two runtime lookups, one for Math and one for random. These extra lookups form the basis for OO and extensibility, however
Musicman
Not saying I don't like the new stuff- don't get me wrong. But I was under the impression that the player itself had undergone some reworking, and was wondering if there was a significant difference anymore, particularly when using many objects at once...
I suppose I'll have to wait to get my hands on the program and run some speed tests.
-
[Devil in DarkGreen]
hi,cno,please try flash mx
it's a good vector painting stuff,the best painting feature is envelope transform
DS
-
@demons re: random() vs. Math.random()
i have always thought that having these two commands around has actually been wonderful and i'm glad to hear that both are *hopefully* still supported
i use the random() function heavily to bump the playhead randomly through the timeline... it's also nice to use if you randomly want to grab an entry from an array
when you use Math.random() you have to actually do more steps to get the number back to a whole number, while random() naturally only returns whole numbers
for instance, if i wanted to set up a 20% chance of occurance, i could simply say
Code:
if(random(5)==1){...}
or i could say:
Code:
if(Math.random()<.2){...}
BUT the instant i try to use a random number more to my advantage (i.e. as a frame number) i do this:
Code:
on(release){
mc.gotoAndPlay(random(20));
}
but it takes more code to produce the same thing with Math.random():
Code:
on(release){
mc.gotoAndPlay(int(Math.random()*20));
}
--------------
@musicman
These extra lookups form the basis for OO and extensibility, however
could you explain this a bit more?
-
For the flash players interpreter to run this line of code:
Code:
mrn=Math.random()*20 //number between 0 + 19
It has to run through this stack of bytecode:
Code:
push 'mrn', 0.0, 'Math'
getVariable
push 'random'
callMethod
push 20
multiply
setVariable
Thats 7 lines of bytecode, bearing in mind thats some of the above commands are slower than others. Then this line of code:
Requires, the flash interpreter to run through a stack of 3 commands:
Code:
push 'mrn', 20
random
setVariable
and it also uses the inbuilt random command in the player.
Therefore the second syntax is an optimization but will only show great speed increases when used intensivley.
-
Moderator
Wow, thanks for the detailed explination Guy. Looks like random() is still the way to go for games programming where random integers are called for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|