asdronin
65 posts
|
Topic: Game Programming /
[AS2] Accessing a class variable from nested movieclip
Hi all!!
First of all Happy New Year to you all =).
I found a trouble which looks very simple but I cant get to solve it at any point.
My current scenario is I have a MovieClip that has an associated class to it, then within that class I declare a variable, like “Myvar”, also declare a Movieclip as “MyMC”, inside the MovieClip I create a circle, convert it to a MovieClip and call it MyMC. What Im unable to do is to access the Myvar from within the circle’s timeline. I tried with “_parent.Myvar” and other hierarchy options I could think of but none seem to work, maybe Im forgetting something, sorry if its too simple question, I just cant find a solution. Thanks for any help or idea =).
PS I forgot, I cant access through root as Im creating many instances dynamically and I not having a list of them
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Persistant text boxes?
I found a workaround so its all working now, thank you very much for the help =)
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Persistant text boxes?
Thanks a lot Heylon, you are right, this way the variables hold the values after moving to another frame. Now there is just one thing remaining for this particular part to work… as I have assigned several variables to the textboxes in the form (a1 to aN)… isnt there a way to iterate though them assigning values to them? I have seen that “eval” wont work if its situated on the left hand side of the assignement, and in the end I think I will have many textfields with many corresponding variables, so I think the best way for assiging value to the textboxes will be through a loop
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Persistant text boxes?
Hi all,
Im currently creating a kind of form split in several pages, this is done with a MC that has in every frame some textfields needed, then I have a button to move forward and one to move backward, but I have noticed that every time I enter a new frame the textfields are reset, so I was wondering if there is anyway to make them persitant so that if I put some value in my first form (frame 1) and then move to 2nd form on frame 2, the values stored on 1st frame could still be availables… is that possible?
Thanks for any ideas or suggestions in relation to the issue
|
|
|
asdronin
65 posts
|
Topic: Collaborations /
Looking for advisor
Hi all!!
I have developed some games on my own but I feel the need to count with someone’s wise opinion and clever advice in relation with the overal game feeling and difficult level as well as other aspects before future games are released. So Im looking forward to contact with someone who is serious about game making, I will split incoming revenue from ingame ads with him/her at 50% as this stage is very important in my opinion.
Some games I made here at:
www.kongregate.com/games/asdronin
Contact me if you are interested and thanks for your time
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Problem attaching MC in Flash 6
Thanks a lot Skyboy, I think you are quite right, will use the duplicatedMovieClip instead, and just wondering…. is there any resource or even a book you could recommend about the usage of this particular version of flash? I think most of my methodology that was still supported under FP7 wont work under FP6, I bet attachSound for example wont work here either and right now I have no idea how to tackle all the AS2 stuff I use to include
Edit: Additionally…. attachMovie was apparently supported by FP5 according to doscumentation…. isnt there a way to use it? I havent found any… yet
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Problem attaching MC in Flash 6
Yes, you are right Aldrinsmoulder :), some devices dont have the possibility to update the flash player and depend on their company desires to do so, some day maybe every single device will run with 10 but nowadays there are still some machines featuring lower versions, its a bit of trouble but being able to play them on such devices is quite a reward =)
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] Problem attaching MC in Flash 6
Hi all,
Im currently targetting Flash Player 6 users, but for some reasons I cant attach the MCs correctly, I use attachMovie function, I know its FP6 issue as just changing the configuration to anything higher such as FP7 solves the trouble… so Im wondering, is there any special requirement for FP6 attached movieclips? in the documentation it says its supported under FP6, I use to have the MCs on frame 2 with the game itself on frame 3, always with “export on frame 1” unchecked, however I tried checking that option and some other stuff and combinations but none of them seem to work, anyone could tell me anything related to this?
Many thanks in advance.
PS My current code is just loading some tiles and placing them on the stage, so it is 2 for loop nested nothing else
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Algorithm to handle big background?
Thanks NirTivAal, but what you are telling me is that for some unknown reasons flash has not regular speed, and having only one big background… what could cause this? I mean, the explanation you gave me leads me to think of when in games you find like 100 sprites in one scene when the normal number for that game is like 10, if that happens then the game will render slower than usual because the flash engine cant handle that at whatever the speed fixed. But if here I have nothing else than a big image, what causes flash to not render at my desired fps? of course if thats whats going on your solution will make the image scroll correctly as this will skip frame steps to be sure the speed is correct.
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Algorithm to handle big background?
Thanks Skyboy, this method seems like very fast, and I never heard of that before, this requires a bit more of preparation but results should be faster I guess, and good to know about the way to go with dinamic and static backgrounds as I think I will use both in the future
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Algorithm to handle big background?
Thanks, I see, I didnt know that, will keep in mind this though, reading what you said it seems the bitmapdata method will be fine for static background while the other workarounds could be ok for any other type background
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Algorithm to handle big background?
MaToMaStEr thanks for the idea, I think your approach is similar to the one I was trying, maybe better, just one thing… you said you attached and removed the MCs from the stage? one thought I had about that is that maybe it could slow this as dinamically added removed MCs could cause that, but Im not sure, I mean… I tried several solutions near this one, I tried showing and hiding the “segments” of the background as they were needed or not needed and I think I also tried attaching and removing them, but never tried a performance test on this subject
Thepeasant and Corvyday, thanks for that, I never used that command or the BitmapData concepts before, I will try this and see what happens, but according to documentation this command is really fast routine so this could fix that.
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Algorithm to handle big background?
Sorry I didnt get back to this, I just noticed there were answers to my trouble here, and many thanks to everyone that answered.
Heylon, thanks, I checked that, but the issue I noticed is commonnly called “screen tearing”, and I think its due to the “power” flash can handle, so this will happen as far as I think whenever a large-ish background is moving at high speed, in the Shootorials, the background is large too, but the speed is not high enough I think, and when I say speed I mean the speed of pixels advanced per frame, maybe Im totally wrong, that what I saw reading everything I could on the subject and testing every single idea.
Thanks RivaledSouls, I think Im moving at regular pace of whole integer and starting also at whole number, I think in the middle this wont go strange to half whole number or anything as in the example I did it was just few lines moving the big background, will write down your idea anyway as I didnt know this could be bad, its interesting to know that issue too.
Skyboy, yeah you are right, it has been a while, but I never managed to solve this, I published my game the better way I could but the screen tearing phenomen was still visible at some points, so Im still open to any new ideas or solutions to this (asuming there is a solution to this within flash)
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
While (hitTest(x,y,true)) is giving me strange results.
Originally posted by Moonkey:
It probably doesn’t rerender the level between iterations of the loop, so it just uses a bounding box instead.
Try testing different coordinates until you find the gap, rather than moving the whole level a pixel at a time.
var shift:Number = 0;
while (level.collision.hitTest(player._x, player._y - shift, true)) {
shift++;
}
level._y += shift;
I think you are quite right as it seems to bounce off from the bounding box instead of touching the shape of the platform instead.
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
While (hitTest(x,y,true)) is giving me strange results.
Well Im not expert and without seeing the fla itself is hard to tell, but I think one thing that could help you is this issue I spotted. You move the stage using one unit steps but at certain moments the player will be more than a unit away for the level (say 1.5 units), so moving the stage one unit wont put you just above the level, you have to move the level using steps of 0.5 maybe as this is the smaller step you use to increase the velocity… I think, dont know if that will help.
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
[AS2] sound halts actions for half a second when played
Hi all,
Im not too new to AS2 but at times like this one my confidence gets down as it seems everything is ok but not working properly in the end.
Im making a simple game, and despite I have included sounds before in a couple of games now its halting the whole action every time they play for half a second. I use short sounds (and even a sound I used before) and I use this method, I attach the sound in certain object “onLoad” function like:
mysound=new Sound();
mysound.attachSound("ok.mp3");
Then in the object that checks wether the sound has to be played or not just:
_root.myobject.mysound.start();
My situation is that they play ok but the whole screen freezes for like half a second, this will break my gameplay as its supposed to test user reflex.
I have been thinking several days about a solution and even compared with my previous codes but I think Im doing all as it should be done. My sounds are not loaded into first frame but in 2nd embeded within a MC, in 1st frame is the preloader MC and code for that, dont think this could cause anything as the sounds are played fine and audible the way they should be, they just halt everything for a short time, and Im sure the call to start the sound is made only once per click, already traced that, currently there is not even background music and when the sound is played there is not much thing done, tried that also outside flash once published and the effect is the same, and tried with Flash Player 10 settings as well as Flash Player 7 which is my target but both work the same in this fact.
Im feeling lost into this, could someone please give me any idea? thanks for your time and efforts.
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
AS2 Error 1203
Thanks Explodingferret, yes you are right, that fixed the problem, so thanks a lot, really =)
By the way… then should I asume that there is something like a maximum size for a function?
Oh and I have CS4, maybe the error numbers vary from one version to another, I got the error number from adobe searching the incidence that I got. But anyway now its all fixed =)
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
AS2 Error 1203
Hi all,
I have been working on next game and I found this trouble all of a sudden, according to documentation it corresponds to error number 1203:
Branch between <spanStart> and <spanEnd>> exceeds 32K span.
This jumps related to an .AS file I have that is getting a bit large, but not too nested, I mean my bad interpretation is that, as it mentions the “branch”, I cant nest a lot in big file, of course thats not the right interpretation, so after looking for information, I found very little in relation to this… could this be that no AS file can exceed 32kb in size? Anyway, could someone please tell me how can I avoid this error? Thanks for your time
|
|
|
asdronin
65 posts
|
Topic: Kongregate Labs /
First game on Kongregate, need some C&C please
Thanks GormenGhast, I think this idea is nice, there is also one point that I wanted to somehow use with the combos, I mean, what I wanted is that the player could be clicking safely just after the new flag is shown, but with the time he/she should feel not so safe until the point of doubting whether to click or just wait for next flag, of course this can cause many combos to be lost, but at the same time… if one measures well the timing, the new flag could be somehow predicted as the timing is not random. Will rethink this fact if there comes a sequel.
And as said, thanks SeanCooper5454, I hope you like it =)
|
|
|
asdronin
65 posts
|
Topic: Kongregate Labs /
First game on Kongregate, need some C&C please
Thanks for posting SeanCooper5454, and yeah I know spare time is hard to find at times, but hey I think we are all in similar situations, well, whenever you find your time for this let me know =)
|
|
|
asdronin
65 posts
|
Topic: Kongregate Labs /
First game on Kongregate, need some C&C please
Hi all,
I uploaded my first game in the past days and the fact is I failed because i didnt put there a preloader in the moment of launch so many people just visited and left away thinking that it wasnt working, now its all fixed, but what Im wondering is… is it good for you? is there any wrong concepts applied there? just wondering, I dont think I will apply changes to this game (I cant tell that for sure either) maybe for the future games or if there is a sequel who knows
http://www.kongregate.com/games/asdronin/color-star
Wii compatible version
http://www.kongregate.com/games/asdronin/color-star-wii
Any comments are welcome, thanks for the help
PS If this is not the right place to post this please move it to where it fits best, sorry if thats the case
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Could someone please tell me why this isnt working
Ah so I will do it that way then, I forgot to uncheck the option in a couple of symbols and now loads from almost 0 so I guess its the way it should done…
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Could someone please tell me why this isnt working
Thanks Jonathanasdf, just to be 100% sure Im doing all the needed… are those items with linkage name also the ones that need to be placed in the empty frame in the main timeline?
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Could someone please tell me why this isnt working
But, the only “things” from the library that I can check/uncheck the option from are those with linkage name, as the rest just have that option grayed (or I think all of them have that, not sure though)
Edit: I forgot to mention that I added to that final frame you mentioned all the symbols with linkage name, but just those, not the rest, dont know if thats correct for this to work at its best
|
|
|
asdronin
65 posts
|
Topic: Game Programming /
Could someone please tell me why this isnt working
But that should mean 30% of the game is in the loader? its just vector line and the text field… or maybe its referring to other stuff in the main timeline but not on 1st frame?
Also, I unchecked everything that has a linkage name to be loaded from actionscript… what else should I uncheck then?
|