so because i am starting university this year doing some variety of multimedia shit including flash and games dev, i need a refresher in my scripting.
hence i am opening this thread in the hopes of being asked some challenging questions to job my memory... and maybe even make me learn something in the process instead of sitting on my ass playing LoL.
so if you have a more advanced question post it here and if it seems like a legit problem that you couldn't have solved in google in under 2secs then i'll help you within several days (i am not online constantly and fuck you if you expect me to be).
DISCLAIMER: i reserve the right to assault you with ALL MY RAGE if you ask me how to make a button or post "howe do i maek game"
Advanced Actionscript; The "Ask Scarecrow" thread
Started by: Scarecrow | Replies: 14 | Views: 2,137
Feb 2, 2012 6:45 AM #586068
Feb 3, 2012 7:13 AM #586994
Quote from Scarecrowso because i am starting university this year doing some variety of multimedia shit including flash and games dev, i need a refresher in my scripting.
hence i am opening this thread in the hopes of being asked some challenging questions to job my memory... and maybe even make me learn something in the process instead of sitting on my ass playing LoL.
so if you have a more advanced question post it here and if it seems like a legit problem that you couldn't have solved in google in under 2secs then i'll help you within several days (i am not online constantly and fuck you if you expect me to be).
DISCLAIMER: i reserve the right to assault you with ALL MY RAGE if you ask me how to make a button or post "howe do i maek game"
bro remember me? Highly_Scented? I'm an advanced actionscript person now too.
Just gonna ask what's up, how ya doin
Feb 3, 2012 11:50 PM #587480
i remember you mang
can't complain how about you
can't complain how about you
Feb 4, 2012 1:24 AM #587541
Quote from ScarecrowDISCLAIMER: i reserve the right to assault you with ALL MY RAGE if you ask me how to make a button or post "howe do i maek game"
Okay how can i make a game? lol...i had to say it
But think you will have a hard time in those classes with flash?
Feb 4, 2012 2:23 AM #587579
Quote from I Pwn3d Jo0Okay how can i make a game? lol...i had to say it
But think you will have a hard time in those classes with flash?
i very much doubt it
Feb 23, 2012 3:28 AM #607099
so i take it nobody codes here any more?
Feb 23, 2012 4:39 AM #607126
The only AS I knew was how to make buttons in AS2
If you would like you could run me through making buttons in AS3. From my experience the same code doesn't work, and neither does anything I've gotten from a google tutorial lol.
If you would like you could run me through making buttons in AS3. From my experience the same code doesn't work, and neither does anything I've gotten from a google tutorial lol.
Feb 23, 2012 4:43 AM #607128
I still code somewhat, but I've had to stop to actually focus on animation and school which kind of sucks.
Feb 23, 2012 6:22 AM #607165
Quote from Arch-AngelThe only AS I knew was how to make buttons in AS2
If you would like you could run me through making buttons in AS3. From my experience the same code doesn't work, and neither does anything I've gotten from a google tutorial lol.
import flash.events.MouseEvent;
//imports necessary AS events
myMc.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
myMc.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
myMc.addEventListener(MouseEvent.CLICK, onClickHandler);
myMc.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
myMc.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
//adds event listeners to handle mouse events on a movie clip with instance name "myMc". the listeners
//will throw a function when the events they are looking for occur. eg: if you mouse over the movieclip,
//the "onRollOverHandler" function will fire.
function onRollOverHandler(myEvent:MouseEvent){
trace(“Over”);
}
function onRollOutHandler(myEvent:MouseEvent){
trace(“Out”);
}
function onClickHandler(myEvent:MouseEvent){
trace(“I waited for Press AND Release!!!”);
}
function onPressHandler(myEvent:MouseEvent){
trace(“Press”);
}
function onReleaseHandler(myEvent:MouseEvent){
trace(“Release”);
}
//above: functions with dummy effects for each of the mouse events you can use.
that covers any kind of button you might want. be sure to read the comments.
here is the code for a basic button click, if you're uninterested in the alternatives.
import flash.events.MouseEvent;
//imports necessary AS events
myMc.addEventListener(MouseEvent.CLICK, onClickHandler);
//adds event listeners to handle mouse events on a movie clip with instance name "myMc"
function onClickHandler(myEvent:MouseEvent){
trace(“I waited for Press AND Release!!!”);
}
//function with dummy effect to demonstrate mouse click effect
Feb 23, 2012 6:47 AM #607173
Are the others using the same programme in your uni course?
Feb 23, 2012 6:51 AM #607175
among others yes
Feb 24, 2012 3:06 PM #607815
What's more efficient or faster for returning a positive integer: Math.abs() or using bitwise shifting?
Feb 25, 2012 10:40 AM #608132
bit shifting is much faster. the most efficient method i've found is:
however this only works for non-float (without decimal places) values.
if you are looking for more optimizations, here is a helpful page i found:
http://blog.coursevector.com/notes-math-optimizations
there are alternatives for most math operations there
var x:Number = -23;
var nn:Number = (x ^ (x >> 31)) - (x >> 31);
trace(nn);
//returns 23
however this only works for non-float (without decimal places) values.
if you are looking for more optimizations, here is a helpful page i found:
http://blog.coursevector.com/notes-math-optimizations
there are alternatives for most math operations there
Feb 25, 2012 12:47 PM #608157
If it only works with non-float values then why didn't you just strict datatype it to Integer? What is the relevance of the number 31 in there?
Feb 25, 2012 1:21 PM #608169
do you know how to make a scene selection?