FAQ  •  Login

Flash! T_T

<<

kalibu

User avatar

Private 2
Private 2

Posts: 30

Joined: Thu Sep 04, 2008 4:40 pm

Location: Portugal

Post Thu Jul 16, 2009 11:48 am

Flash! T_T

So, here's the deal:

I just don't know how to work with flash xD

I have a preloader on frame 1, and then an animation until frame #1987.

I want to do this: preload the animation, and then loop it from frame 5 to 1987. I've been the whole day trying this. Preloader's working fine, but the loop isn't. It loops to the frame 1 again. :\ can someone help me with that? T_T
yeah!
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Fri Jul 17, 2009 2:29 am

Re: Flash! T_T

i havn't played with actionscript for a while so bare with me on this....

for your pre loader im assuming you are using the complete file size which would mean your code for that would look something like:
  Code:
loaded = Math.floor(_root.getBytesLoaded()/ getBytesTotal()*100);

if (loaded == 100){
gotoAndPlay("finished");
}else{
gotoAndPlay("loop");
}


That basically works on a % of the file downloaded.

For your loop there is 2 ways i can think of, the first one and this one in not 100% sure on but cant you highlight frames 5-1987 then right click and select loop, That would work if it can be done...

or there is the code way:

in the first frame of animation which i am assuming is 5 add action:

  Code:
var i = 0;


and then in frame 1987 add this action:

  Code:
if (i<4) {
gotoAndPlay (5);
i++;
}


that will loop frames 5-1987 4 times or for an infinate loop just add this action to frame 1987:
  Code:
gotoAndPlay (5);



let me know if you need anymore help
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

kalibu

User avatar

Private 2
Private 2

Posts: 30

Joined: Thu Sep 04, 2008 4:40 pm

Location: Portugal

Post Mon Jul 20, 2009 5:13 am

Re: Flash! T_T

that's weird, because I used the "gotoandplay (5)" and in the preview it still looped to the frame 1... :?
anyway, I'll try this and then tell you something.
yeah!
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Mon Jul 20, 2009 4:18 pm

Re: Flash! T_T

feel free to email the fla and i will play with it for you
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

kalibu

User avatar

Private 2
Private 2

Posts: 30

Joined: Thu Sep 04, 2008 4:40 pm

Location: Portugal

Post Thu Aug 06, 2009 1:51 pm

Re: Flash! T_T

ok, here's another question about Flash:

I need to simulate a flash preloader. The idea is quite simple: make BytesLTotal=100 and an increment to BytesLoaded from 0 to 100. BytesLoaded++...

the code went fine, but the increment was too fast. I wanted to have a slower increment... like 500ms each increment. here's an attempt

  Code:
var loaded_bytes:Number = 0;
var total_bytes:Number = 100;
while (loaded_bytes<100) {
   //trace(loaded_bytes); - it's just to check if the cycle is working
   loadpercent = (loaded_bytes/total_bytes)*100;
   numloader.text = int(loadpercent)+'%';
   tree.gotoAndStop(int(loadpercent));
   loaded_bytes++;
}
gotoAndPlay("Main", 1);
Last edited by kalibu on Wed Aug 12, 2009 1:26 pm, edited 1 time in total.
yeah!
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Fri Aug 07, 2009 2:01 am

Re: Flash! T_T

what you are doing there is actually making a preloader which will load up as quick as it takes to load the file, maybe try making the file bigger or just making a preloader as an animation.

I will have a play with flash in a bit for you and see if i can work out an easier way to do it, its like 7am over i have just woken up
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

kalibu

User avatar

Private 2
Private 2

Posts: 30

Joined: Thu Sep 04, 2008 4:40 pm

Location: Portugal

Post Sat Aug 08, 2009 11:48 am

Re: Flash! T_T

well, techincally it's not a preloader.

the thing is: i'm creating a preloader to sell. and the site ask for a preview for the preloader. So, all i have to do, is send the .fla with the preloader and an swf with an animation of the preloader:
if you are making a preloader, make sure the preloader preview fakes the loading so that the user can see a demonstration without having to clear their cache. You can do this by creating a variable and counting it up from 0 to 100 and using it as the bytes_loaded, with bytes_total being equal to 100.


so, that's what i'm trying to do.
yeah!

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.