Tag Archives: flash

Big Problem with NME, Jumping Platforms Again

So, despite going on about my l33tness, there’s some things I can’t or shouldn’t do. It turns out I’ve run into a very severe roadblock with HaXe+NME. Well, HaXe is great, the problem is with NME or specifically nme.text.TextField because you see, it doesn’t mimic all the functionality of flash.text.TextField and specifically it doesn’t have the Stylesheet parameter or any other way to change the colour of individual sections of text within a particular textfield. In otherwords, NME simply won’t work for what I’m doing, and I’m back to square one.

Well, before I was thinking of doing it with JavaScript, and I realized that not everyone has JavaScript, or is JavaScript capable. But everyone can view a PHP page! So, this’ll be the forth platform I’ve jumped to on this project. It’s starting to get a bit ridiculous, but such is life. If PHP doesn’t work out I’ll fall back to JavaScript; it’s an important part of the internet and an important part of advanced HTML5 content, so if you’re blocking it by default you’re going to miss out on a lot anyways.

*work work work* I’m just trying to figure out this neat Aptana IDE I downloaded. It can be an extension of Eclipse, but I downloaded the standalone. It’s interesting. I think I’ve got it just about figured out. I’ve gotta say though, it’s weird when I’m trying to figure out a program and all of the screenshots in the manual are from a mac and I’m running it on a PC. XD

*work work work* Okay I’m feeling comfortable with Aptana now, and the PHP makes sense after reviewing the PHP tutorial at w3schools. Love that site.

Notable problem; PHP has no Objects. I’m used to OOP. I could probably make it all work by using a database to store the data I would normally put in objects.

Frankly I’m still indecisive about everything else. Like Flash. I’m great for coding with AS3; I don’t need to lay about for hours reviewing the syntax and all that. Yeah, it limits the places my textgame can go, but there’s also the fact that they may add the StyleSheet to NME. I already requested it on their forum, and asked for advice in their programming area. No idea if I’ll get any hits there, but it’s something.

Right now I’ve got nothing up, and this is supposed to be my first ‘Give Me Money Plz!’ thing, where I make something you want and you give me money to make more. So, I’m not makin’ any money untill I get something playable. I need to stop screwing around and just MAKE the darn thing.

So, that’s that. Next time, back to Flash, untill NME gets what I need. Then I can translate it all to HaXe like I did with the scrollbars.

Not sure if I’ll keep using the scrollbars; they have issues. We’ll see.

Hungry now, and almost midnight. Break time.

Tagged , , , , , ,


Hokay so it’s tomorrow, but I haven’t gotten much more thought on the Action issue.

Here’s how it works in my head. The player chooses an action, and that action is added to the timeline, so that when the duration of the action is up, the action will be completed and the player will be prompted to take another action. During that time, other things will also be taking actions, and sometimes they need to interrupt what the player is doing.

The timeline is basically an ordered list of actions like get thing, approach thing, or rest. In certain situations, an action will interrupt the action of another mobile. If something dangerous appears, it’ll interrupt your rest. But, you still had some rest, or you still walked a certain distance. For non-instant actions, I have to consider how far you got before you were interrupted.

I think that if I include a ‘Current Action’ property in the Thing class, it’ll allow me to have a link to the specific Action that any Thing is doing. That way when another Thing’s Action interrupts this Thing’s Action, I can determine how far along the Action was, and correct things.

One problem I’ve got is interception. Suppose there’s a guy walking across a field, and you approach him. You’re not approaching the spot he was, you’re approaching him, so your movement gets pretty complicated, probably some sort of arc. I’m going to have to do some pretty serious math, I think. ^.^;;

Anyways, for any non-player Thing, the Behavior function is run when they finish an action, or when they’re Interrupted, and that function is given the same list of possible Actions that the Player would be, and they select their next Action from the list.

Alright I think I’ve done too much thinking and worrying about this. I’m going to code it, and if it doesn’t work I’ll fix it.

*work work work*

I was thinking of measuring the player’s strength as a quantity of Newtons, or the amount of force they’re able to apply. I have no idea how I’d quantify that for Agility or Endurance though, so instead I’ll use the D20 method. 10 is an average person’s strength, agility, and endurance.

*work work work*

Okay that gives me the basic data classes.

*work work work work work*

Okay! Now I’m going to make the first edition of the actual TextWorld class. And since this is Flash, I’m going to just go ahead and make the TextWorld hold the graphics and do the processing both.

Hokay it’s been a while, but as I recall I’m going to have four textField objects. What shall they be called? Oh, oh yeah, I made that scrollbar thing, so I have to make the scrollbars, and then put the TextFields in them.

Aww buggery some guy is chatting me up, so I’ve completely lost my groove. I’ve got to go home after he’s done. But, progress!

Tagged , , ,

Struggling with Actions

I’m back at the cafe and ready to work some more on TextWorld. Whenever I see Mr. Notch pop up on the Twitter and I see he’s working on his space game, I think to myself “Why aren’t I working on MY game?”

Well, I don’t feel comfortable making my own space game untill I have a computer that can handle 3D nicely, but the TextWorld still needs much work, so working I shall be doing!

Now, after my previous post I had many deep and great thoughts on the walk home, and it occured to me that in order to generate custom actions, I would need to create some sort of scripting language, which seems terribly grandiose at this stage. As such, I’ll begin by only using hard-coded actions, and grow the TextWorld from that. I have considered that I could do a simpler form by ‘overriding’ various actions. An action which changes the name and description of a thing could be overridden to change the name and description in a different way. That may be a good way to go in the mid-term.

For now, I’ll make an Action class, which will contain a list of static functions taken from the ActionTasks class. Each of those ActionTasks will be something like ‘Set this property’ or ‘Remove this property’ or ‘test against this attribute’. Hmm… There goes that if tree again. I worry that I’ll need to do conditionals and loops in the actions.

Maybe I should go for the overrides earlier on. Make the possible actions all big complicated affairs. Hmm… This’d be easier to visualize if I had some solid examples. Let’s try a few.

Guntry uses the Get action on a Cake he found in the street. The Get action first checks to make sure that Guntry can lift the cake by checking Guntry’s strength against the cake’s weight plus his encumberance. Guntry can lift the cake, so the cake is removed from the street and added to Guntry’s “Held” location in his equipment.

So even with something as simple as a get action, I’ve got to test against a mobile’s statline and do an if tree.

Hmm… Maybe instead of making ‘build your own’ actions, I should hard code all the actions and just have some actions where you can change the text or flags that you’re setting or removing.

Shoot. So complicated.

Hmm… What if the tasks are each function objects that pass their product down the line?

Hmmmmm… What if the tasks are each arguments of the next task?

Oh! What if for a conditional task, I pass the option tasks as arguments?

TestStat(_stat, _value, _winCondition = null, _loseCondition = null, _epicWinCondition = null, _epicLoseCondition = null);

Then each of those option tasks would be able to call another task, and another, untill the action was resolved.

Test the Strength against 100grams
if pass then transfer cake to inventory

Here’s another action. Swing Sword at Steve

Determine Steve’s response, Steve tries to dodge
Test player agility against Steve’s agility
If Player wins, then
-> Test penetration between player’s sword and steve’s defenses,
-> If Sword wins, then
—> Assign damage to Steve based on the force of the blow
—> Apply the Injury property to Steve
—> Apply the Bleeding property to Steve
-> Reduce durability on steve’s defenses, where applicable

In another way…

Player clicks Steve. The …

Hold on a minute. It just occured to me that the Context Menus won’t be constant, and many different things interacting with the same thing would require different Context Menus. There’s no reason to have the Context Menu be a member of the Thing class; a Context Menu should be generated on the fly by the TextWorld when the player clicks on a thing. I’mma remove that from the Thing class right now.

Okay back to the thing.

The player clicks Steve. A context menu is generated by the TextWorld based on the player’s proximity to Steve. The player is right next to Steve so it gives them the options Talk, Interact, Offer, Attack. The player chooses Attack, and since they’re equipped with a short sword and a buckler, it gives them the options Swing Sword, Thrust Sword, Shield Bash, and Kick.

Each of those three options is an Action; the first four would lead into another context menu. The Actions have their text changed to suit the context. Swing Sword is based off of Swing Thing. Whatever’s in your hand, you can swing it at somebody, including an empty hand, which is a Punch. A thrust in that instance would be a Jab, if I have my fighting words right.

These are standard actions from the action library. Oh! I should call the class ActionLibrary! I tell you it has been hard coming up with a name for that class. FOCUS. These are standard actions from the ActionLibrary. Each one is made up of a list of Tasks from the TaskLibrary. So, the TextWorld sees that the player is in range to use the swingThing Action and includes it on the ContextMenu. The swingThing Action’s task list is as follows:

interrupt(target), // This prematurely ends the target’s previous Action.
requestCombatResponse(target, dodge, block, parry, counter, ignore), // This asks the target to respond, and offers five handler actions as choices. The handler action takes over, from the target’s perspective

The dodge Action’s task list is like this:

testAttribute( AGILITY, // A Constant for the particular stat
testCondition, // In this case, the attacker’s agility
winCase, // Another

… Wait wait wait stop. This is getting really really really complicated and I’m not sure it all fits together properly.

The more I do this the more I wonder if I should just hard code complex actions instead of building them out of tasks. The time thing is the most difficult, though. It’s like, everything in the world is constantly doing something, and in order for one thing to interact with another, it has to interrupt that thing. Doing an action takes time. If you’re walking down a street, that might take a minute. In that minute, you might walk all the way, or you might be interrupted. What that means is that I have to be prepared for partially finished actions.

Hah, I’ve really got myself into a lot of trouble with this. This is what I get for trying to simulate a world in Text instead of just making a regular sort of text game.

Well I’m getting really very uncomfortably hot and it’s getting surprisingly close to my bed time, so I’m going to wrap this up and give it some thought overnight, perhaps. I’m sure I’ll either figure it out or figure out a different way to do what I want.

Tagged , , ,

What’s an Action, Anyways?

So it’s been a while since I worked on the TextWorld project; I got tied up in other things for a bit. Last time I put together a sort of solution for the room filling problem. The other night it occured to me that when I started this, my intention was to experiment, including some experiments combining visual elements with my text. In particular, something like roguelike tiles. If I did that, then the dynamics of space would change quite dramatically. Well, that’s something to deal with in the future; to start with I want to get this version of TextWorld actually operating.

One thing that’s been bothering me as I go about this is that Thing and it’s children are basically data classes, and the TextWorld object will be doing the work. So I’m not sure how much data checking to put into the data classes. Like the issue with the size; should that be determined by the Space or should it be up to the TextWorld how to deal with the space, while the space object only defines the properties? One thing I didn’t do when I did the volume checking solution was check if the space’s dimensions should modify, if it’s deformable. Again, should that be done by the data class, or by the functional object?

Ahh, that reminds me, another thing I intended to do after my Tile Matching Game was finished was to study Object Oriented Design Patterns. I’ve just been coding haphazardly.

Huh, there’s a convenient page all about them right here. http://www.oodesign.com/

*think think think think think*

Yeah, the more I think about it, the more I realize that while data format checking is okay, like my percentage and degree checkers, the Space class itself should not be determining if something can be added to its contents. I’ll remove that check from the class and just let any Thing add itself to the contents.

Hmm… That said, nothing should be in two places at once, so I’ll keep the code that removes a thing from it’s previous space.

Hmm… I wonder if I should do it that way…

I could have an interface class, which displays the actual data, a TextWorld class, which assembles and manipulates the data, and a series of data classes. That sounds like a good way to do it. Internally, the ContextMenus will just be a list of links to actions. How the Context Menus are actually displayed will be determined by the interface.

*read read read* Oh I like where it calls something I made up on my own the “Expert Solution”.

Anyways I’m not sure this is helping that much, since it seems to expect a certain level of familiarity to begin with.

So getting back to actually doing something, since I’m just making these into data classes, I’ll run through the other two relatively quick, but I’ll have a lot of other stuff to roll over.

Actually it might be a good idea to take a moment and go over what I need again.

MainInterface – The Visual Interface, with its four quarters and context menus
TextWorld – The world simulation, which contains the space tree and manages the interaction of the objects therein.
Thing – A physical thing in the world
->Space – A bounded region of space in the world, which may contain Things, and is itself a Thing
->Mobile – A Thing which potentially moves under its own power and has a statline and inventory
->Exit – A Thing which joins two Spaces
ContextMenu – A list of Actions which can be taken with regard to a Thing
Behavior – A collection of functions which are called when a Thing’s turn comes up, determining it’s next Action

I’m thinking about doing an Actions class which defines all the possible actions in the world. Actions like Get, Drop, Approach, Attack, that sort of thing. A ContextMenu would be a list of links to Actions. Both the user, and other entities in the world, would interact via Actions. The tricky thing is custom actions.

I want people to be able to extend the world without changing the code, including myself. So, I need to be able to load actions the same way I’ll load objects and spaces when I’m loading a world.

Hang on, I’ve been at this for like two and a half hours. I’d better take a break. Normally I’d pack up and head to the library, but they’re closed for good friday. I’d kind of like to switch to one of the cushy chairs for a while, but I’m afraid I’d miss out on my plug. Maybe if I moved to the far end where those guys aren’t sitting… I’ll give it a go.

*takes a break*

Heh, I wonder how much of a break it is if I have my headphones on the whole time, my ears need a break too. ^.^;;

Alright so before I continue to make these classes I think I should figure out how I want the actions to work. How can I define an action in a way that they can do whatever the writer wants without having to make new code? I suppose it would be a script made up of built in possible actions.

So, there will be standard actions and user defined actions which are made up of a set of simple actions performed together to make more actions.

Hmm… I could make an Action class which represents a specific action, and BaseActions which contains all of the possible things an action can do. An Action would be a combination of those things.

Hmm… That break didn’t seem to help much. I’m feeling kind of hyper and yet reluctant to move. I kind of want to have lunch, and I kind of want to have Grilled Cheese sandwiches, but for that I’d have to go home, and I’m not sure I could come back afterwards.

Hmm… I think I’ll do it. I’ll go home and make Grilled Cheese sandwiches, and if I don’t come back here, I’ll at least try to write out some ideas for actions. Once I have a better idea how they’ll work, it’ll be easier to put together the Mobile class.

Tagged , , ,

Set Up Adding to and Removing from Spaces

So in the interim since I posted last I realized that even if I went to the trouble of coming up with the math to test for space, it would be too complex in general, and especially if I ported this to JavaScript or PHP.

To simplify things I’m going to stick with volume for the Spaces. In order to be moved into a space, a Thing can’t have more volume than the remaining empty volume in the space. I’ll test scalar properties when passing through an exit, rather than being added to a space.

I’m suddenly wondering if it’s good coding practice to have a class with a member typed as a subclass of itself.

*work work work work work* Okey dokey now I’ve got addToContents and removeFromContents, so a Thing can be moved into a Space and out of a Space.

I guess that’s the Space class done, untill I figure out something else it needs. Still remaining are Mobile and Exit.

I didn’t do much today but I think I need to wrap it up, I’m just not feeling right, but I wanted to at least do something.

Tagged , , ,

Less Methods than Anticipated

So I’ve got my properties declared and my getters and setters set up; most of them are kind of superfluous but I figure it’s better to have them and not need them than to need them and not have them.

I still have to formally decide on my standard methods and such, though, don’t I? What things must every Thing be able to do? Well, figuring that out was the point of the post two posts ago, so let’s look at that and see.

The formatting and such will be done by the TextWorld object. It’ll take the data from the Thing and use it to assemble the description. So, I don’t need any fancy formatting methods.

Hmm… Actually it seems like most of the action comes in Thing’s children. There’s not much for it to do but be a storehouse of information, so the getters and setters should be pretty much ‘enough’. Even with the context menu, the TextWorld class will just say ‘Hey what’s your ContextMenu?’ and it’ll be there, no need for methods.

Even the behavior is only checked every moment, and the TextWorld will put all the things into a queue in order of action, a ‘who goes next’ sort of thing. Anything without a Behavior goes to the back of the list, untill something acts on it and it gets a Behavior.

This is weird, I was sure that the Thing would have a bunch of methods but it seems like I was wrong. I guess I’ll move on to making the Space class. I know that’ll have a lot of methods, ’cause it’s got to determine if this or that thing will fit inside of it or not.

*work work work* It’s tough to decide when to do data checking. With a Space which has both outside and inside dimensions, what happens if the inside won’t fit into the outside? I intend to put the data checking in the function that actually modifies them. Ultimately it doesn’t REALLY matter, since nothing should be broken programatically if something is bigger on the inside. It might even be neccesary for a high fantasy game, or a Dr. Who rip.

One thing I’ve been thinking about is using a simplified cheat for figuring out if something can fit into an object. To start with, I’ll see if there’s enough room based on volume compared to the volume of the space minus the volume of the objects already in the space. If there is, then I’ll check if it would fit in any orientation. If it would, then I’ll let it fit into the space. This would mean that potentially there could be two things in the same space that could only fit if they intersected. It’d be a lot easier to code, though. I haven’t decided for sure though. The good thing is that if I decided to upgrade it later that should be possible. I already don’t plan on having the simulation do anything weird if a user puts a Thing in a Space that couldn’t fit; it just won’t be able to move into that space from outside. If it’s already a part of that space, it’ll be okay. I think that’s important since there will likely be Things that are in a room like the walls and windows that are embedded into the edges of the space and thus be bigger than them.

Well it looks like I’m out of time; it’s getting kind of uncomfortable in the cafe with the lights dimmed and the coffee table off the floor so they can clean under it. I figure they’ll close in under 20 minutes.

Tagged , , ,

A Thing’s Properties, Getters and Setters

So it had been my intention to write up the values for a small world, and run it through the logic internally to figure out what classes and things I’d need. Well as I worked on it, it gradually became clear how difficult it would be to track which thing is where in any text format. So, I’ll take what I’ve already learned and start coding up the classes now, and I’ll just have to modify them if I missed something. I’ll probably have to anyways, eventually.

I had considered making the world editor right now, to make the files, but I think that should wait untill I have a solid idea of what goes where. For now, I’ll hardcode the worlds. It’ll be much easier to do in code, where I can make clear references instead of just saying “This thing is in that thing” and having to look it up myself. When I do make my world editor, it’ll have to clearly show the connections between different Things. What Space you’re inside, and what Things you’re connected to, including contents, inventory, and for exits, where you lead.

So that brings me to the next step, which is the step I was working on before. I’ve got to define the Thing class.

I’ve already got the properties set up, except for the contextMenu, which is commented out ’cause I don’t have a contextMenu class yet. I’m going to use getters and setters for all of the properties, ’cause a lot of them have important limits.

After a quick experiment, I see that FlashDevelop can generate default getters and setters for class properties. Way to go, FlashDevelop. You get a gold star.

Now let’s see, do I want to measure orientation in degrees or radians… degrees or radians… I think I’ll go with degrees. It’s what I’m most familiar with, and it’s nice and simple.

*write wirte write* Okey dokey. Now when you set the x orientation, it has to be between 0 and 360, and if it’s not, it’ll circle around. So, setting it to 370 will give you 10, and setting it to -10 will give you 350. I am so awesome. Now to copy that setter for the other rotation properties.

And durability is a percentage, bound between 0 and 100.

*work work work* It would be nice if I could use my setters as the arguments for the constructor function, instead of having to come up with a third name for the parameters.

Hmm… I guess with all the getters and setters I don’t need to have all these optional parameters in the constructor. I’ll just leave it at name.

Hmm, I’m pretty much out of time, and I’ve only finished off the properties. I was hoping to get some or all of the methods defined tonight, but I guess it’ll have to wait.

Tagged , , ,

Scroll Bar Getto!

At the library today, and gonna work on that scrollbar some more. Just before I had to stop last night, I got the scrollbars KINDA working, but not really. Well, the vertical scrollBAR is working, and the other elements are all WORKING, but they’re all in the wrong places. The down buttons are 180 on the far point, and I’m going to guess the up buttons are too, but I can’t see them. The bars work, you can click em and scroll em and all that good stuff, but the horizontal bar is vertical for some reason. I’m really not sure what’s up with that.

For the up and down buttons, my best guess is that they made the art in the Flash IDE with the registration point at the lower right corner instead of the upper left. Well I guess I can respect that, though it convolutes things.

*tries drawing the boxes so that the registration point would be at the lower right corner*

Huh, well that didn’t work. Now I can see the up buttons, but not the down buttons, and the up buttons are to the upper left of where they should be. Puzzling.

Well, instead of changing where the registration point would be, I’ll change where it’s drawing them.

Hmm… I think it’s drawing them underneath the background. I’ll change the order they’re added to stage.

Okay there they are. Now there’s just one more problem with the vertical scrollbar; the scrollbar won’t scroll all the way to the bottom. My guess is the range was set based on the location of the down button, which I’ve changed.

E-yup, that seems to have fixed it. ^.^

Next problem. What the heck is up with the horizontal scrollbar? o.o

*read read read* Yeah it’s clearly written to end up like this… But hang on, is it possible that in the Flash IDE they merely rotated the scrollbar so that up and down became left and right? o.o;;

*sets rotation to -90* Well son of a gun, it works. I’m tempted to change it so it’s properly horizontal instead of just a trick, but I didn’t pick up this class so I could re-write it myself.

Okay now it’s working perf… effectively. Now I’ll fix it up a bit. Well, first I’ll make a backup of what I’ve got so far… Okay.

Now I’mma get rid of all those MovieClips. They’re awful heavy when a Sprite is good enough.

Hmm… Oh, they actually used the functionality of MovieClips to make the buttons button. That is, the different frames were the over and click states and things. Hmm… Well, I can’t programatically create new movieclip frames, so I guess I’ll just have to workaround that functionality.

Oh! I know a cheap trick I can use. I can jam a colour transform on it when it would normally switch frames. It only has two states anyways. I’ll make a colour transform that brightens it up.

*does that* Well that takes care of that.

Now I’m going to change the way the graphics look so they’ll match my text game, and when that’s done I’ll move the code over to TextWorld.

*work work work* Codin’ up some graphicalness… Been at this four hours already. I’ll have to take a lunch break soon.

*work work work* Alright, it looks proper and it works. The only thing left is to move it into my TextWorld project. I’ll do that, then go for lunch!

*work work work* And there it is! Now, lunchtime! <3

Tagged , , ,

Wrestling with the MyFlashLab Scrollbars

Now I’m back and actually working on the scrollbar stuff. I overlooked the download of one I was going to try, and it looks good. No fancy dependancies or requirements, just a couple of classes. Now I’ll test it.

*work work work* Okay it has some errors when I try to compile. It looks like it was meant to be done in the flash IDE using a pre generated library image. I’ll just create a thing for it to display instead…

Hmm, it only works with movieclips. And it has a hell of a lot of movieclips. I should be able to fix that but first I want to get it to actually work, so I’ll make a movieclip first.

Hmm… It looks like there’s another thing in the library that isn’t in the code, a skin object. Let’s see what I can do about that. *read read* Yeah it looks like it assigns various properties of it to variables. I can just instantiate the properties at those variables and it’ll be the same difference. Except, I only have clues as to what they’re supposed to look like. I guess I can compare the demonstration swf from the website though…

This brings another question, now that I think of it. Should I make the interface out of vectors or bitmaps? I’m hoping to make the text game scalable, later, so people with high res monitors or bad eyes can change the size of the text and UI elements. The text in Flash is represented as vectors, I think, so I should make the ui elements vectors too. But then, how to do that? I mean, there are options. I could draw them by code, which is hard and makes them hard to update, but there should also be a way to import vector images into flash apps. Never actually done that, only bitmaps. I should do that, just to say I have!

First I’ve gotta look up the deets though, ’cause it might be different than doing it with bitmaps. I want to know what kind of file format to use too. I know you can save vectors as .svg but there’s probably other options too.

Also we’re having a bit of connection trouble at the cafe I code at, and I’ve got to say it’s a pet peeve of mine when a browser downloads and displays a web page but can’t get the CSS, and displays it ANYWAYS. What is up with that? If you can’t download the whole webpage, don’t display it! Give me an error or something. People who are less computer savvy probably don’t realize that the .css isn’t loading properly. Geez.

Okay now that the internet is workingish, I’m able to do research. It looks like I was right, all I have to do is make it a sprite instead of a bitmap. Way to go, embed command.

Now to actually make the vectors. This’ll be interesting, since I haven’t got a lot of vectoring experience. Well, there’s only one way to get that!

Now if anybody is curious, I use a copy of Jasc Paint Shop Pro 8 for most of my arting. It’s a pretty decent program I’ve used quite a lot over the years. I guess it’s pretty old now. Why do I use it? Well, my Dad got a legit copy of it a while back, and I love legit copies of software. I also use Paint.NET for things where Paint Shop Pro is too big and powerful and I just want to do some cheap pixel art. My laptop is pretty weak, you understand, and graphics processing is intense.

*finishes an up arrow* Oh. Well, I just learned something today. Apparently Paint Shop Pro 8 can’t save images as .svg files! I guess that’s what I get for using decade old image processing software.

I’m starting to consider drawing the elements by code anyways. I mean, for one thing, I don’t have an art program that’ll let me save vector art. But also I realized as I was working on it, that anyone who used this scrollbar would have to bring the art in as well, and I was already complaining about dependancies and things.


Oops I got lost on the internet for a while, but I’m back now.

So, right. I’m going to generate the vectors by code. BECAUSE I CAN. I’m a foolish fool, sometimes.

Hokay, it looks like Controller_H and Controller_V are container objects, so they don’t need graphics. Oh, also it looks like they spelled controller wrong. Well, I can refactor-rename so that’s no prollem.

*work work work* Well that’s not right. I’ve gone ahead and made all of the elements into magenta squares, and when I run the app they flash on screen then disappear. What’s up with that? Le-sigh. I can only guess the size and shape was important in some way to the scrollbar. I really have to wonder if this isn’t more trouble than it’s worth.

If there’s one thing that’s clear about these MyFlashLab people, it’s that they love nesting MovieClips. These classes of theirs will be pretty much unrecognizable when I’m done with them.

Only twenty minutes left before the cafe closes. Time is so fleeting. I have plans for when I get home, that I’m looking forward to, but I wish I could get more done here first. Alas.

Hmm… This is perplexing. From everything I’ve read, it should be displaying properly, with magenta boxes for scroll bars, but whenever I run it, it just shows up big boxes then they disappear.

Hmmmmmmm… I know they’re on the stage since I can see them for a moment, but their positions are all wrong. They appear in the middle of the stage and then vanish.

Aha! I figured it out. The content they were supposed to scroll wasn’t big enough, so there was no need for scrolling. I’ve fixed it, and now they appear, though they’re positioned wrong. I can fix them though. This should work out.

For now, though, I’m afraid I need to pack up and go home. Just five minutes to closing. At least I did something productive today!

Tagged , , ,

FlashX and More

So I was planning on working on TextWorld but as I was going through my documentation I realized that it hadn’t been updated since Flash 11, I was still using the Flash 10 documentation. When I looked up the Flash 11 documentation, I noticed there was a whole new set of libraries called FlashX, so I looked them up.

Well, the official documentation only seems to include the flashx.textLayout class and it’s children, but that was enough to get my attention, since the thing I planned on doing today was making a more usable text area. Of course it also got me thinking that, hey, maybe someone else already made a better text area and published it in an open source library I can use, so there’s all sorts of fun stuff to do.

While I’m at it, I’m updating my version of FlashDevelop, which is currently downloading the latest version of the Flex SDK. I wonder if I even had the right SDK for doing Flash 11?

Anyways the library’s internet is pretty fast, even on a day like today where it’s packed with young people playing web games. So it shouldn’t take too long for that to come down. Then I’m going to try out some libraries.

Hmm, after reading some more, it looks like the flashx I looked up was just something called flashx and not the one that’s in the documentation.

It’s frustrating and notable that the documentation for this flashx package is incomplete and not helpful compared to the rest of the really nice flash documentation.

Looking through the documentation some more, I see that they also added some more text components to the base flash package, like flash.text.engine and flash.text.ime

Hmm, I’m going through this stuff too fast and suffering from information overload. Yeah there are a hell of a lot of libraries out there.

You can really see the reasoning behind deciding to reinvent the wheel when you realize there’s a thousand different implementations of the wheel concept and you never know which one has special requirements or elements you don’t want untill it’s too late.

*takes a break*

Hokay, new version of FlashDevelop is all downloadified and installulated, and I spent a while checking out Reddit and Twitter. I’m feeling a bit more relaxed now.

Still got no autocomplete for this flashx package. Still not sure how it even works.

Hmm… The more I go over this the less important it seems for my purposes. While it might be nice to have more advanced text display, it doesn’t seem to solve my basic problem of incorporating a scroll bar into the textField object.

I guess I let myself get caught up in nothing much at all.

Before I get back to my own project instead of screwing around with libraries, I’m going to screw around with libraries more. There were a couple of bits that caught my eye in that info overload earlier and I want to check them out. I’ll try to be more careful this time!

*does so* Okay yeah, this library seems to have had a year or so since it was last tended to, and if it has any documentation I’m not seeing it. I think it might be meant for use with the Flex Builder IDE too.

One last thing to do before I get back to work… *googles as3 textfield with scrollbar* Oh, geez, it was already going to autocomplete the word scrollbar. I guess this is something people search for a lot. Second link is a question on StackOverflow specifically refering to my exact situation. First link is a blog entry where someone explains how they included the UIScrollbar component in a TextField in pure AS3.

The StackOverflow question doesn’t tell me anything I didn’t already know. The blog post is about developing in the Flash IDE where it’s easy to just grab the UI element. Bleh.

I did some more Google-Fu but the more I read the more obvious it is that it would be easier to reinvent the wheel than to keep looking for the right wheel for me. The good news for you guys is once I make this thing, I’m going to publish the source so you kids at home don’t have to go through with this crap.

There is a problem, though. textField isn’t a displayObjectContainer so I can’t put the scrollbar inside of it. I could either put the textField inside of a parent object with a scroll bar, or I could make the scroll bar and textField unrelated, only connected by function calls.

Ideally I want to stay away from the traditional form of a scrollbar, so I don’t want to use any default UI elements even if I could. I don’t want them to look like default UI elements either. Since I’ve already got this nice texty looking page format, I want to keep it texty looking.

Anyways now that I’ve convicted myself to making my own scrollbar, I’m going to close up this blog entry and start another one specifically about that.

Tagged , , ,