Author |
Message |
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Fri May 16, 2008 7:44 am
|
|
|
I'm not sure how to do this, because the preloader won't work unless I name the first and last frames. How do I go about this? |
|
Back to top |
|
|
Jr. Troopa Admiral Bobbery
Joined: 19 Jun 2007 Posts: 3866
HP: 15 MP: 2 Lives: 0
|
Posted: Fri May 16, 2008 9:29 am
|
|
|
I've worked a bit with Photoshop CS3, and I believe that you have to save, each individual frame, as a picture. It takes a bit to do, but it gets the job done. Also, I'll try to explore Photoshop CS3 a bit more, and see if there is another way around this. |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Fri May 16, 2008 2:59 pm
|
|
|
Jr. Troopa wrote: | I've worked a bit with Photoshop CS3, and I believe that you have to save, each individual frame, as a picture. It takes a bit to do, but it gets the job done. Also, I'll try to explore Photoshop CS3 a bit more, and see if there is another way around this. | It's Flash, not Photoshop. |
|
Back to top |
|
|
Jr. Troopa Admiral Bobbery
Joined: 19 Jun 2007 Posts: 3866
HP: 15 MP: 2 Lives: 0
|
Posted: Fri May 16, 2008 4:50 pm
|
|
|
Ah, sorry about that. I read the title wrong. I'll look into this issue in Flash CS3 and do some exploring and see what I can find.
Did the help section help at all, or give any hints? |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Sat May 17, 2008 2:39 pm
|
|
|
Jr. Troopa wrote: | Ah, sorry about that. I read the title wrong. I'll look into this issue in Flash CS3 and do some exploring and see what I can find.
Did the help section help at all, or give any hints? | It's pretty useless. D: |
|
Back to top |
|
|
He's that guy. Merlink
Joined: 16 Aug 2007 Posts: 3522
HP: 10 MP: 1 Lives: 0
|
Posted: Sun May 18, 2008 9:35 pm
|
|
|
So why do you need to name the frames? Can you just give the frame number, or am I thinking of something different? |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Sun May 18, 2008 9:46 pm
|
|
|
Merlink wrote: | So why do you need to name the frames? Can you just give the frame number, or am I thinking of something different? | Well, since every scene each has its own frame 1, then if I entered it into the preloader code, it would just start the preloader over again. D: |
|
Back to top |
|
|
He's that guy. Merlink
Joined: 16 Aug 2007 Posts: 3522
HP: 10 MP: 1 Lives: 0
|
Posted: Sun May 18, 2008 9:57 pm
|
|
|
Geno wrote: | Merlink wrote: | So why do you need to name the frames? Can you just give the frame number, or am I thinking of something different? | Well, since every scene each has its own frame 1, then if I entered it into the preloader code, it would just start the preloader over again. D: |
You know you can enter the scene number too? I believe it's like this:
Code: | gotoAndPlay("Scene1",1); |
Unless, of course, I'm think of the wrong thing. |
|
Back to top |
|
|
Goomba Vampire
Joined: 21 Apr 2007 Posts: 2287
HP: 95 MP: 1 Lives: 1
|
Posted: Sun May 18, 2008 10:08 pm
|
|
|
Ok, so you probably want to put an instance name on a frame, yes?
Ok, so click the frame you want/need, open the properties tab (if you can't find it, press Ctrl + F3) and look for a box with the text "Frame Label" in it. Put what you want to call it, say you call it "Geno Whirl".
So, you put this code on to a button
Code: | on (release){ _root.gotoAndPlay("Geno Whirl"); } |
NOTE: This is on memory, and not tested.
I'll explain the code too: on (release) is an event listener, it basically senses things, this particular one senses a release of the mouse on a button.
_root means that you are calling upon the main timeline, and nothing else.
gotoAndPlay is self explanitory
("Geno Whirl") tells Flash that you are looking for the field in the parenthesis. The quotes tell it that it is an instance name used at some point in the document.
Hope it helps! |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Sun May 18, 2008 10:14 pm
|
|
|
Goomba wrote: | Ok, so you probably want to put an instance name on a frame, yes?
Ok, so click the frame you want/need, open the properties tab (if you can't find it, press Ctrl + F3) and look for a box with the text "Frame Label" in it. Put what you want to call it, say you call it "Geno Whirl".
So, you put this code on to a button
Code: | on (release){ _root.gotoAndPlay("Geno Whirl"); } |
NOTE: This is on memory, and not tested.
I'll explain the code too: on (release) is an event listener, it basically senses things, this particular one senses a release of the mouse on a button.
_root means that you are calling upon the main timeline, and nothing else.
gotoAndPlay is self explanitory
("Geno Whirl") tells Flash that you are looking for the field in the parenthesis. The quotes tell it that it is an instance name used at some point in the document.
Hope it helps! | Ah, thanks!
This is just the explanation I needed.
Thank you also, Merlink. |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Mon May 19, 2008 7:49 am
|
|
|
Eh, well, I'm trying to make it so that as soon as it's done loading it plays, but I get this error:
1087: Syntax error: extra characters found after end of program.
But I copied it exactly... D:
I dun get it. |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Wed May 21, 2008 7:56 am
|
|
|
DAMN IT! I've tried everything!
It just WON'T work!
I got the message again just now.
I followed the instructions here to the dot:
http://www.smartwebby.com/Flash/Flash_simple_preloader.asp
And still NOTHING WORKS!
Apparently there's something wrong with the line: ifFrameLoaded ("end") {
That doesn't make sense because the last frame in the animation (so far) is called end, and it refuses to work.
I'm not working on my animation until the preloader works 100% flawlessly. |
|
Back to top |
|
|
BONK! Pfargtl
Joined: 31 May 2007 Posts: 1679
HP: 100 MP: 8 Lives: 0
|
Posted: Wed May 21, 2008 2:46 pm
|
|
|
A preloader in CS3 requires a long line of code. Here's what I found on Yahoo Answers:
Code: | stop(); function onPreloaderOut() { preloader_mc.removeEventListener("onP... gotoAndStop("SITE"); }
preloader_mc.addEventListener("onPrelo...
preloader_mc.startPreload(this);
and as file is
class Preloader extends MovieClip{
private var target_mc:MovieClip; private var progress_mc:MovieClip; private var pct_str:String;
private var dispatchEvent:Function; public var addEventListener:Function; public var removeEventListener:Function;
function Preloader(){ mx.events.EventDispatcher.initialize... }
public function startPreload(t:MovieClip){ target_mc = t;
this.gotoAndPlay("IN"); }
private function onAnimateIn(){ this.stop();
this.onEnterFrame = this.checkLoadProgress; }
private function checkLoadProgress(){ var bl = target_mc.getBytesLoaded(); var bt = target_mc.getBytesTotal();
var pct = bl/bt;
var cf = progress_mc._currentframe; var tf = progress_mc._totalframes;
var f = Math.ceil(tf * pct);
if(f > cf){ progress_mc.play(); }else{ progress_mc.stop(); }
this.pct_str = (Math.round(cf/tf * 100)).toString();
if(bt > 20 && bl == bt && cf == tf && progress_mc){ onPreloadComplete(); } }
private function onPreloadComplete(){ this.onEnterFrame = null;
this.gotoAndPlay("OUT"); }
private function onAnimateOut(){ this.stop();
dispatchEvent({target:this, type:'onPreloaderOut'}); } } |
Yes, this is the CS3 preloader code.
Last edited by Pfargtl on Wed May 21, 2008 8:04 pm; edited 3 times in total |
|
Back to top |
|
|
The Axolotl Sympathist Geno Werewolf
Joined: 26 Jul 2007 Posts: 8754
HP: 100 MP: 4 Lives: 1
|
Posted: Wed May 21, 2008 6:55 pm
|
|
|
Shit... D:
Do I have to enter anything into that? Because I don't know where to start that...
And why would they make it harder to use the newest version? Lame. D:
Last edited by Geno on Wed May 21, 2008 7:42 pm; edited 1 time in total |
|
Back to top |
|
|
He's that guy. Merlink
Joined: 16 Aug 2007 Posts: 3522
HP: 10 MP: 1 Lives: 0
|
Posted: Wed May 21, 2008 7:32 pm
|
|
|
That was the longest preloader code I have ever seen. |
|
Back to top |
|
|
|