Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.23 / 5.00 3,881 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.93 / 5.00 4,634 ViewsSorry for the late reply, was preparing for an exam.
At 10/22/14 10:56 AM, Aprime wrote: We have loaders[aNumber]
This works nicely if aNumber has been set to a number
One could do aNumber = 4
However, if we completely get rid of aNumber
We'd have loaders[0], loaders[2], etc
Which would be good to indiviually call each image.
However, for my removeChild...
If I wasn't sure which image had been displayed and would want to remove it regardless of which image is displayed...
How could I remove this child?
So instead of referencing an int, number or unit... how could I remove the whole loaders regardless of what number it's on, without the use of uints, ints and numbers?
Because removeChild(loaders)
without listing the number would cause errors.
But I don't want to use state which number in the array, because I want to remove them all.
And I don't want to use [aNumber], because I'd like to know how to do it without this, even though I'll actually use it.
Basically, I want to removeChild(loaders) without listing the (loaders[numberInside])
Well...in short, you can't. There's no way that I know of to remove all the items inside an Array from the stage *in one call. There's a way to remove it from the Array or Vector...
loaders.length = 0;
but the items previously inside the loaders Array will still be on the stage.
To remove all the items in the loader from the stage, you'd have to loop through all items in the Array or Vector and individually remove them. A for loop, in this case, would create a temporary variable with an initial value and loop just until it has reached the length of the Array, (not inclusive) so it would access the last element, loaders[loaders.length - 1]:
for(var i:uint = 0; i < loaders.length; ++i)
{
removeChild(loaders[i])
}
It creates a temporary variable, i, as a uint and sets it to 0:
for(var i:uint = 0;
and the loop will continue as long as i is less than loaders.length, that is, 1 less than the number of elements in the Array:
i < loaders.length;
and after executing the code within the brackets, that is,
{
removeChild(loaders[i])
}
it'll increase i by 1 and execute the code within the brackets again:
++i)
You could set aNumber to i:
for(var i:uint = 0; i < loaders.length; ++i)
{
aNumber = i
removeChild(loaders[aNumber])
}
or declare it as aNumber (be wary of duplicate variable definitions):
for(var aNumber:Number = 0; aNumber < loaders.length; ++aNumber)
{
removeChild(loaders[aNumber])
}
or ignore aNumber entirely and declare a new 1-letter (by convention) variable like in the first example.
At 10/23/14 10:09 PM, FinaLee wrote: I also just realized after typing this that I never paid for the hotdog I got.
1) get free hotdog
2) smoke joints
3) egg cars [trainspotting intensifies]
4) ??
5) wake up
Michael Jackson because I can't remember any other at the moment.
At 10/22/14 05:52 AM, Aprime wrote:At 10/21/14 01:54 PM, Gimmick wrote:Oh, sorry. Those 12345 was only there to catch my attention when looking at my many traces.At 10/21/14 06:05 AM, Aprime wrote: trace(getElementAtAndRemoveChild+"12345123451234512345");I'm not passing "123123132342" with the quotes, because then I'll be passing an incorrect parameter type -- String, where a Number is expected. Remove the quotes, and if it looks like a number, it'll be taken as a number.
Oh, never mind then :#
If I have addChild(loaders[1]), and later on I'll have addChild(loaders[2]) etc.
Is there any way for my remove child to remove the child whatever number is inserted?
Without setting it as addChild(loaders[aNumber]).
?
You can use a loop, or increase aNumber each time.
This maybe impractical not to use aNumber, and use [1], [2], [3] etc. I'm just more curious on how that would work, I'll prob end up using [aNumber] anyway.
You'd get the same result in the end, if you set aNumber to 1, then it's the same as just using [1]. And so on.
Sorry, I meant removeChild(loaders[aNumber]);Also, why couldn't one just removeChild(aNumber); instead of having a function?
Oh.
Instead of having the original
function getSomeLoader(aNumber:uint):Loader
{
Which I'm still not sure what the advantage of this is.
In this case, there's little to no advantage because that functionality is already present -- just using removeChild(loaders[aNumber]) would do the same thing as the function itself. The function's redundant in this case. However, if there were many lines inside the function then it'd make a difference, but here it's a bit frivolous.
You'll have to get the URL of the mp3 file stored on NG's servers AFAIK. Dunno about how to, though. There's probably an API or so that you can use.
This is more of a site question rather than a Flash question, so it's better to ask it in the Where is / How to? forum. Be sure to mention your browser, and your operating system and as many other details as you can supply.
This is more of a site question rather than a Flash question, so it's better to ask it in the Where is / How to? forum. Be sure to mention your browser, and your operating system and as many other details as you can supply.
At 10/21/14 07:23 PM, ErikMasters wrote: Okay so the other day I started working on a flash animation, and somehow i made my timeline window all huge and extremely awkward. Does anybody know how I can change the size of this?
If you don't mind losing your layout, then go to Window (top menu) ==> Workspaces and then click on some other layout.
At 10/21/14 06:05 AM, Aprime wrote:At 10/19/14 10:30 AM, Gimmick wrote: function getSomeLoader(aNumber:uint):LoaderSorry, I'm really bad at this. I've never really worked with returns before.
{
// return loaders[index] <== wrong
return loaders[aNumber] //<==right
}
No problem, you'll get used to it :)
function getElementAtAndRemoveChild(aNumber:Number): Loader //because it's easier to understand
{
contents.removeChild(loaders[aNumber])
return contents.loaders[aNumber]
}
trace(getElementAtAndRemoveChild+"12345123451234512345");
traced = function Function() {}12345123451234512345
Ohh, no that's not right, see you're calling getElementAtAndRemoveChild() with a number in between the brackets, that's what the "parameters" mean -- getElementAtAndRemoveChild( <some number> ) will result in aNumber being equal to that number.
Another way to look at it: trace() is a function. Whenever you do trace(getElementAtAndRemoveChild+"123123132342") then you're passing "getElementAtAndRemoveChild" and "123123132342" as a parameter. To understand what happens behind the scenes here...
=> trace(getElementAtAndRemoveChild+"123123132342")
==> trace() is defined as:
function trace(objects of type object):void
{
get all objects passed (in this case, they are "getElementAtAndRemoveChild" and "123123132342"
look for their toString() property, that is, convert them to strings
output their string
return nothing, that is, void
}
==> getElementAtAndRemoveChild
===> this has a function called toString(), which returns "Function()"
===> Not what we want, though, but that's just how it is
==> "123123132342"
===> already of type String (see the double quotes? those make them strings of their literal value)
==> combine the two
===> "Function()123123132342"
===> pass this on to trace
====> trace("Function()123123132342")
=====> outputs "Function()123123132342"
In short, that's not how you call a function. To call a function, type the function name and surround the parameters with brackets. Like so:
getElementAtAndRemoveChild(123123132342)
I'm not passing "123123132342" with the quotes, because then I'll be passing an incorrect parameter type -- String, where a Number is expected. Remove the quotes, and if it looks like a number, it'll be taken as a number.
The main problem is, I don't know how to get aNumber to equal the loaders number which is on stage?
If you have a loaders value on stage, for example:
var numPics:int = 0;
then you can set aNumber (in the function) as the parameter, like so:
getElementAtAndRemoveChild(numPics);
At which point, aNumber is set to numPics (think of aNumber, the parameter in the function declaration, as an alias for the actual parameter, in this case numPics):
===> var numPics:int = 0;
===> getElementAtAndRemoveChild(numPics)
====> getElementAtAndRemoveChild is defined as:
function getElementAtAndRemoveChild(aNumber:Number):Loader{
removeChild(loaders[aNumber])
return loaders[aNumber]
}
====> equivalent to, in this case:
function getElementAtAndRemoveChild(numPics):Loader{
numPics
removeChild(loaders[numPics])
return loaders[numPics]
}
I could just assign aNumber and number and make loader[aNumber] at the beginning. I thought there would be a way to fetch it the other way.
You can! There's no need for a function every time, the same function, getElementAtAndRemoveChild, can be written as:
var aNumbers:Number = 0
//set it to some number
removeChild(loaders[aNumber])
var someOtherVariable:Loader = loaders[aNumber]
You'd just have to call it many times and that'd get irritating, and it's much tougher to track down return values if you type it out instead of using functions.
Also, why couldn't one just removeChild(aNumber); instead of having a function?
Because aNumbers is of type Number. The function removeChild() only accepts things that extend (are a part of) DisplayObject (things that can be shown on the screen). A number is an abstract item, you could think of: A representation on the screen, is just the text value of the number. The actual number is represented by a 32-bit floating point number. If you did removeChild(aNumber), then you'd get an error because you can't remove something that can't be added. It's like putting a square block in a circular hole. However, using loaders[aNumber], returns a Loader (loaders[aNumber] using the array index access operators [] looks up the thing at that number and return it, so you're technically not removeChild(aNumber), but you're removeChild(loader at aNumber)).
I'm not saying it's wrong, I'm just trying to understand.
No harm in that.
At 10/20/14 12:57 AM, MSGhero wrote: The syntax is very similar, but much better. Openfl specifically mimics the flash api (openfl.display.DisplayObject, etc) while haxe just looks like as3. There's a tool that literally converts as3 code to haxe code with a high success rate because the two are so similar.
Oh OK. So I can make it in flash and convert it to haxe later if required?
He skypes me when he sees people confusing haxe and openfl.
I guess I'm marked for death now xdd
At 10/19/14 11:07 PM, MSGhero wrote:At 10/19/14 10:24 PM, Gimmick wrote: But is OpenFL the same as Haxe as far as a project in it is concerned?PSvils is screaming in his sleep. Haxe is a programming language. Openfl is a library within haxe. Haxe projects target swf, java, js, cpp, c#, etc. Openfl takes some of those and makes them more usable: swf, html5, android, ios, native, etc.
Lol, I figured as much, but I was confused when MintPaw said "(I assume you mean OpenFL)" -- is there a difference between Haxe and AS3 in terms of learning it when not using OpenFL?
BTW is PSvils still around here? Haven't seen him in quite a while.
OK. Since Arrays in Haxe are typed, I assume they'll perform just the same as Vectors when exporting to swf?Int, UInt, and Float Arrays might get made into Vectors, but everything else as a vector performs worse than in an array in those cases. Honestly, it might just put everything into arrays because it's not that big of a performance difference.
OK.
At 10/19/14 07:26 PM, MintPaw wrote: They're also developing HTML5 tools meaning they've already kinda given up.
Wow, Adobe's giving up before putting up a fight? That's rather sad...
1) Where do I actually learn Haxe comprehensively? Some tutorials I've seen just show some of the syntax and other stuff.It's actually so similar to AS3 that you could learn it just like AS3. (I assume you mean OpenFL)
But is OpenFL the same as Haxe as far as a project in it is concerned?
2) What do I do when there's multiple types of a similar class in a project? For example, there's openfl.vector and haxe.ds.vector if I remember correctly, is one better than the other or is it just better to use haxe.ds.array or the like?Don't bother with them, try to use only OpenFL classes if you can. Also Arrays in Haxe are typed, so they function just like Vectors in AS3.
OK.
3) Is there any performance hit in haxe and openfl as there is in flash? For example, using static classes and so on.Yes, although statics aren't too much of a performance hit, they're more of an organization hit. Haxe is translated into AS3 for swf exports. So any issues that you had with performance are still there.
OK. Since Arrays in Haxe are typed, I assume they'll perform just the same as Vectors when exporting to swf?
4) Is it bad that there's no true "private" in haxe?Not really, I doubt you'll really even notice.
OK. Thanks!
At 10/17/14 08:26 AM, Aprime wrote:At 10/16/14 09:35 PM, Gimmick wrote: stage.addChild(contents)Contents is on the stage as a movieclip.
Ah ok, no problem there.
? What does tracing loaders[index] return?I get "Access of undefined property index."
I've probably made a really noobish mistake. Am I supposed to replace index with the number?
If so, this is fine. But how would I make it so that it would remove the child regardless of which number in the array it is?
Well yes, index is supposed to be replaced with number / a variable of type Number, int or uint >= 0. It's preferable to have uints or ints because Number will not be recognized (fractional indices will lead to what is technically an "associative array" which is an array where the indexes are of type String. It's not as good as using normal indexes because of some reasons I forgot)
In this case, it sounds like there's no variable called index. You could fix it by replacing "index" with <name of variable that looks it up> e.g.:
function getSomeLoader(aNumber:uint):Loader
{
// return loaders[index] <== wrong
return loaders[aNumber] //<==right
}
Not all anti depressants will work for everyone, it may take a combination of antidepressants for you and you'll most likely identify the correct one and its effects only after many weeks. They have side effects, though. So...YMMV?
At 10/19/14 01:19 AM, FurryGod wrote: There's no hard science that supports any of that, they're just placebos if anything.
If you want to cure your depression I suggest taking up a hobby.
Um, no.
At 10/18/14 03:30 PM, Gagsy wrote:At 10/18/14 10:43 AM, Gimmick wrote:Ayy lmaoDude tell me when you call someone a pussy are you thinking of them as pusillanimous or as a kitty cat? Cause I'm wagering its neither.
Nope, not thinking about pusillanimous (although kitty cat was often the ones I'd heard of in cartoons) but pusillanimous eventually warped to pussy and people don't know about it because maybe they didn't really care about the origin as much as the meaning in itself
At 10/18/14 11:00 AM, Ejit wrote:At 10/18/14 10:43 AM, Gimmick wrote:Out of interest, do you think terms like faggot and gay are still hateful slurs associated with homosexuality or have they been used as casual disses - as the kids are all saying - for long enough to acquire an independent meaning?At 10/18/14 10:18 AM, Gagsy wrote: Its the ole "everything associated with women is weak while everything associated with men is strong".Ayy lmao
AFAIK once a hateful slur, now a casual diss -- but it still depends on the context? If one person knows the other's gay and calls them a faggot, it's a slur whereas if they don't know then it's a casual diss, at least that's what I think.
Every time I have a function that returns a Rectangle, I can't help but giggle inwardly when I name it getRect.
At 10/17/14 06:32 AM, Rustygames wrote: Looks guys, I changed my little picture thing, now I'm Rusty Sunglasses person
WHO ARE YOU
At 10/18/14 10:18 AM, Gagsy wrote: Its the ole "everything associated with women is weak while everything associated with men is strong".
At 10/17/14 09:56 AM, halfblue3 wrote:cacheAsBitmap? In the image's properties or the movieclip's properties, select Cache as Bitmap or set its cacheAsBitmap property to true. Don't know if it will work, though, since images don't need to be cached as bitmap and will usually just increase the memory usage and not significantly increase performance.that's what i think i've seen before, that cacheAsBitmap thing. so, it won't solve the problem. do you think replacing that image with a drawing from Flash or a movieclip without image will solve the problem?
Well replacing the image with a drawing shouldn't do much, if anything, because the Flash player has to do more work to draw vectors than bitmaps. That's why cacheAsBitmap works for movieclips with vectors/line drawings - it converts it to a bitmap, so to say, so that it won't have to do more work.
As for the movieclip without image, well you can try it. Huge images may slow down the flash player, but I haven't really tested that.
Running Chrome 38.0.2125.101 m, Windows 7 if that matters.
Whenever I click on an emoticon in the PM (above the PM body text) it shows the selection "corner" box moving to that emoticon, but when I click "Send", it always defaults to the first (black concentric circle).
I'm updating Chrome if that matters, but does anyone else have this problem?
At 10/17/14 07:12 PM, PirateCrab wrote: But seriously, I'll block you.
...should someone tell this guy the truth...?
At 10/15/14 06:23 PM, yurgenburgen wrote: Now he advertised hydrogenated stock jellies. He appears on adverts making false claims about Knorr stock "sealing in" the flavour of chicken and all this bullshit. It just blows my mind that someone who can cook the best food you'll ever taste is peddling garbage.
Hey, he's just following the money trail.
At 10/17/14 02:58 AM, Sevkat wrote: WAH WAH WAH SCTE3 DIDN'T LIKE MY THREAD
WAHW AHWAH WAHWHAWH
You need to grow the fuck up.
^
At 10/17/14 02:14 AM, cga-999 wrote:At 10/17/14 02:06 AM, Gimmick wrote:@cga-999 - my reaction when I'm reading your posts:Isn't that nice.
mj_eat_popcorn.gif
For me, yes.
At 10/17/14 02:14 AM, Zerodecoole wrote: Stay at drugs
Eat your school
And don't do vegetables
It should be noted that I favor, and that he does not agree with me, that I know, said he, in his 7th year, will choose not to choose, prepare a little sin here. I found an hour ago, without any research or similar, I'm in the middle, I use it to apply to College in the area to help test show that I 99.9th%can It would be better to control it, and I sent the test should not övervägas. Mother-to-child 8 years old, he graduated from Virginia Polytechnic University, and a brilliant engineer. In 15 years, I understand the physics of dollars more than it is, or too small, I don't deja. all details are telling me that I was wrong, and I think I have to be serious and not very sensitive. A particularly successful engineer, but it's not a bad result, I think it's very, very good exercise that many engineers don't know. I am also very good technique.
At 10/17/14 01:46 AM, Sevkat wrote: Fucking, wow, this is an awesome thread.
Modern aristocracy is an embellishment of both standardized recruiting techniques, and post-baccalaureate fallacy.
Our internal standpoint is now that of an extremist's promiscuity. Nothing lies in the balance.
To one, or another, it's really just a game of counter-intuition on either party's side. Either way, Communism is good.
OP, I can use badtranslator too!
"Modern aristocrat-beautiful, all the methods in the United States, research fallacy.Our in the fields -you need courage. Not in balance. You what can I say or someone who's just a game, a pretty face."
Wow so much hate against @SCTE3 'cus they're one of the few remaining active mods on the forum and locked a thread (and then unlocked it)
OP - What the fuck man. 3 people called you a troll on the thread. THREE. Deal with it; NG has and has always had lousy people (more so in the past).
FFS this thread has more replies than OP's original post.
@cga-999 - my reaction when I'm reading your posts:
mj_eat_popcorn.gif
At 10/17/14 12:21 AM, MintPaw wrote: Yeah, but that vague, technically Tween and Color are in the mx package, but I'd still consider them flash classes. And even the flash package you have to import to use. You're not meant to think about function like that, nothing is really 'default' or 'custom', when it's imported it's imported.
OK; good to know, thanks! So is it okay to think of custom functions as "functions in imported non-Adobe classes"? :p
At 10/16/14 10:00 PM, MintPaw wrote: That's not really relevant, trace the width before, apply whatever, trace it again. If it's different and not showing visually that's the issue.
Well I did this now as:
// two movieclips called "txtWas" and "strike" like in OP's
// one with width 7, the other with 140.95
trace(strike._width) //output: 7
trace(txtWas._width) //output: 140.95
strike._width = txtWas._width
trace(strike._width) //output: 140.9
trace(txtWas._width) //output: 140.95
And the first time I tried it with getAlphaBounds (not defined AFAIK):
// same arrangement, two mc's with different widths
import flash.geom.Rectangle;
var rectB:Rectangle = getAlphaBounds(txtWas) //txtWas' width is 190, strike's is 100
trace(rectB.width) //undefined
trace(txtWas._width) //190
trace(strike._width) //100
strike._width = rectB.width
trace(rectB.width) //undefined
trace(strike._width) //100
I wouldn't say it's a custom function, it's just a function that's not in the flash package. What would you consider custom?
Yeah that's what I meant, something that's not included by default in the flash package.