So, Steve Jobs says Flash is a bit rubbish and not suitable for running on Apple's uber-cool touchscreen smartphones and the like.
Good.
The less use that's made of Flash the better imo. It's hideously overused - I took a look at a Flash website today - for a lodge business. Why on earth the site was built in Flash I'll never know - ages to load, lousy scrolling and really sucky look all round.
So any disincentive to use the damned stuff on standard websites sounds like a plan to me.
Jobs explains his difficulties with Flash - which can be a great tool if it's used properly btw - in a letter. Sound points in general - the lack of openness, security problems and battery issues convince me by themselves. Worth a read.
Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts
Thursday, 29 April 2010
Monday, 14 December 2009
Hannah says decompiling flash files is fun...
So, let's say your Flash file is corrupt, but you do still have the swf file.
Now, I know what you're thinking. What kind of doofus doesn't keep a back up of their flash file each time they save it eh? Hmm...
Anyway - it is possible to recover some of the fla - maybe not the Action Script, but at least some of the other bits and pieces.
Hannah says she knows someone who knows someone who used the SWF Decompiler from SourceTec software in the free 30 day trial mode. If you pay it might even be able to get he action script for you (apparently - I know nothing about whether this is true, and neither does Hannah).
Hannah says always keep a backup of your fla files. Hannah also says crumbs DM...
Now, I know what you're thinking. What kind of doofus doesn't keep a back up of their flash file each time they save it eh? Hmm...
Anyway - it is possible to recover some of the fla - maybe not the Action Script, but at least some of the other bits and pieces.
Hannah says she knows someone who knows someone who used the SWF Decompiler from SourceTec software in the free 30 day trial mode. If you pay it might even be able to get he action script for you (apparently - I know nothing about whether this is true, and neither does Hannah).
Hannah says always keep a backup of your fla files. Hannah also says crumbs DM...
Monday, 23 February 2009
Flash: multiple answers and upper/lower case
So, a Flash quiz with a text entry box?
Well, what if your user doesn't think the same as you? You show them a car and they write "motor car" rather than "car" in the text box. Shouldn't this be a valid answer?
You need a way of getting more than one answer accepted by the action script.
Here's a walk through...
I created a very basic question:

Really simple, eh?
What we need to do then is attach some ActionScript to the button so that when it's pressed the answer in the box gets checked and we get moved on to the right place in the movie to give the feedback to the user.
The key is that I want to allow an answer of red or scarlet. And I want to allow an upper case answer and a lower case answer (or a mixture in case the user hits the Caps Lock key by accident half way through!).
Here's the ActionScript...
Need to see the script more clearly? Click the image then!
Now, I'm going to walk you through that line by line, so here goes...
1 on(release) {
All this does is say when the button is released do whatever's inside the curly brackets
2. answer.text = answer.text.toLowerCase();
Ah, this is a beauty, but you need to get the capitals in exactly the right places or else it screws the entire thing up. All it does it take anything that goes into the answer text box and convert it to lower case for the purposes of the ActionScript. Clever eh?
3. if(answer.text.indexOf("red") != -1 answer... )
Hmm, tricky. What this is doing is saying if whatever's in the answer box is red or scarlet then do what follows inside curly brackets.
But it does this in a cool way. It looks at the textbox and says if the boolean response (the true/false response) to the question "does it say red?" is not equal to (the != means not equal to...) false (the -1 means "false") then do what comes next. Read that again. And again. Get it yet? That's OK, it's a bit complex. Just know that it works!!
Then it says Or if it's scarlet. It does this with the symbol (you'll find the key at the bottom left of the keyboard just by the zed). This symbol means Or. Promise it does.
4. {
Opens what happens if the if statement is true (i.e. it's red or scarlet)
5. gotoAndPlay(10)
So go to the keyframe which says "Yay, you got it right dude". I could have used gotoAndStop and I could have named the keyframe. Both would have been cool.
6 }
So stop doing this if it's true
7 else
Why, do this if it's not true then...
8 to 11 should make sense - we check to see if we've closed all the brackets!
Adapting the Script:
Easy enough to do. You can keep adding or... by adding answer.text.indexOf("maroon") to the If statement. You can make this line as long as you want - but if there are lots of possibilities then perhaps you need to think about your question?
I'm not sure, but in a long quiz you might want to call the textboxes answer1, answer2 etc...
You can also add a check to make sure the user put something in the textbox. I might blog this one tomorrow if I feel like it.
And you can start to add up right and wrong answers nice and easily if you wanted to. This doesn't take too much doing!
Well, what if your user doesn't think the same as you? You show them a car and they write "motor car" rather than "car" in the text box. Shouldn't this be a valid answer?
You need a way of getting more than one answer accepted by the action script.
Here's a walk through...
I created a very basic question:
Really simple, eh?
- all I have there is a question, an answer box and a button;
- the answer box is set as an Input Text box with an Instance Name of answer;
- then I have a 15 frame animation (it could be 3 frames long actually - I just like to spread my frames out!);
- the Actions layer has stop(); at the 1st, 10th and 15th frames;
- the background layer has my question at frame 1, the "Well done" bit at frame 10 and a "Try again" dialogue at frame 15.
What we need to do then is attach some ActionScript to the button so that when it's pressed the answer in the box gets checked and we get moved on to the right place in the movie to give the feedback to the user.
The key is that I want to allow an answer of red or scarlet. And I want to allow an upper case answer and a lower case answer (or a mixture in case the user hits the Caps Lock key by accident half way through!).
Here's the ActionScript...
Now, I'm going to walk you through that line by line, so here goes...
1 on(release) {
All this does is say when the button is released do whatever's inside the curly brackets
2. answer.text = answer.text.toLowerCase();
Ah, this is a beauty, but you need to get the capitals in exactly the right places or else it screws the entire thing up. All it does it take anything that goes into the answer text box and convert it to lower case for the purposes of the ActionScript. Clever eh?
3. if(answer.text.indexOf("red") != -1 answer... )
Hmm, tricky. What this is doing is saying if whatever's in the answer box is red or scarlet then do what follows inside curly brackets.
But it does this in a cool way. It looks at the textbox and says if the boolean response (the true/false response) to the question "does it say red?" is not equal to (the != means not equal to...) false (the -1 means "false") then do what comes next. Read that again. And again. Get it yet? That's OK, it's a bit complex. Just know that it works!!
Then it says Or if it's scarlet. It does this with the symbol (you'll find the key at the bottom left of the keyboard just by the zed). This symbol means Or. Promise it does.
4. {
Opens what happens if the if statement is true (i.e. it's red or scarlet)
5. gotoAndPlay(10)
So go to the keyframe which says "Yay, you got it right dude". I could have used gotoAndStop and I could have named the keyframe. Both would have been cool.
6 }
So stop doing this if it's true
7 else
Why, do this if it's not true then...
8 to 11 should make sense - we check to see if we've closed all the brackets!
Adapting the Script:
Easy enough to do. You can keep adding or... by adding answer.text.indexOf("maroon") to the If statement. You can make this line as long as you want - but if there are lots of possibilities then perhaps you need to think about your question?
I'm not sure, but in a long quiz you might want to call the textboxes answer1, answer2 etc...
You can also add a check to make sure the user put something in the textbox. I might blog this one tomorrow if I feel like it.
And you can start to add up right and wrong answers nice and easily if you wanted to. This doesn't take too much doing!
Labels:
action script,
Flash,
interactive multimedia,
quiz
Flash scene names
So, you have a movie with a bunch of scenes. But they're all called really useful names like Scene 1, Scene 37 and whathaveyou.
Even more annoyingly, they're not numbered in the right order. Ugh.
Wouldn't it be good if you could rename them? Hey, you might even have tried to do this. And failed...
First off you need to get the scene names up in a panel on the right. You'd think they'd make this easy woudn't you? Hmmm...
Even more annoyingly, they're not numbered in the right order. Ugh.
Wouldn't it be good if you could rename them? Hey, you might even have tried to do this. And failed...
First off you need to get the scene names up in a panel on the right. You'd think they'd make this easy woudn't you? Hmmm...
- Go Window > Other Panels > Scene (hey, keyboard shortcut madness: Shift+F2)
- A little windowy, panel thing pops up
- You can dock that windowy thing over on the right if you click on the little dotty things to the right of the word Scene at the top and drag it into the panels. Easy eh?
- Then you can double click the scene name and rename it
Labels:
Flash,
interactive multimedia,
scene names