Jump to content


ACTION SCRIPT


  • You cannot reply to this topic
7 replies to this topic

#1 CrazyDogster

    Young Padawan

  • Members
  • Pip
  • 4 posts
  • Location:Romania

Posted 21 March 2006 - 10:33 AM

Hello! I have reached the end of my AS skills.. and I was wondering if any of you guys want to help me!

abreviations:
mc(s)=movieclip(s)
AS=ActionScript

Here is the thing:

I want to create a banner wich have 8 images.. small mcs! What I want is: when the banner is fully loaded and starts playing (it is a small slideshow), I want it to play a random mc instead of a movie clip located on the first frame! I placed all my mcs inside a larger mc.. a main one as I want to call all of my mcs with AS.. now.. I know how to call a specific mc inside the main mc, but I do not know how I can randomize the order of the mcs so that each time it loops to load another picture....mc! I also would like to know how to control the mcs as I have in the main timeline only 2 frames:

1. Frame 1 is with the preloader
2. Frame 2 is with all the movieclips... the problem is that I do not want the to start unless I tell them to so I added a stop(); code on the first frame of each small mc! It seems that if I do that even if I call a speciffic mc from the main timeline in frame 2... where I placed my code... and tell the mc to play it does not start...

Could you help me please? as I am in a quite big dilemma!

Thank you!

Edited by CrazyDogster, 21 March 2006 - 10:37 AM.


#2 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 23 March 2006 - 07:29 PM

Can you email me your fla?
I really don't get what you are trying to do.. maybe If I have a look into it, I can understand it better..

#3 CrazyDogster

    Young Padawan

  • Members
  • Pip
  • 4 posts
  • Location:Romania

Posted 24 March 2006 - 01:07 AM

OK... thanks man!

#4 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 27 March 2006 - 05:59 AM

Hey dude..

As your fla file is built up atm, it's quite hard to randomize all the movies. My suggestion:

- Create a movieholder for all the mc's you have
- give those mc's a linkage name
- attach them to the movieholder dynamically via actionscript
- Use the Math.Random() function to randomize the show :D

#5 CrazyDogster

    Young Padawan

  • Members
  • Pip
  • 4 posts
  • Location:Romania

Posted 27 March 2006 - 09:46 AM

Thanks mate! But the problem is: how do I use that function as I do not know just that... I have to make an array and then link them with the Mathrandom? How do I do that....

thanks again! :D

#6 DarkSuiyoken

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 28 March 2006 - 05:27 AM

You can actually name all your small MCs this way:

smallMc1
smallMc2
smallMc3

Changing ONLY the number at the back. That way when you want to attach a movie to the main stage. You do this:

ran=random(8)+1
_root.attachMovie("smallMc"+ran,"smallmc_mc",10)
trace(_root.smallmc_mc)

the trace commands is to make sure that the movie don't come out as undefined. If it does, that means something is wrong. Make sure you make your smallMcs to be exportable by Actionscript. I think you should know how to do this.

As for the line:
ran=random(8)+1

The +1 behind is to make remove the 0 that also comes with random. Because you didn't start your smallMc numbering with 0, this "+1" makes the 0 that you might get, into a 1.

Hope you get what I meant. :P

#7 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 28 March 2006 - 05:36 AM

that's a nice solution :P

#8 DarkSuiyoken

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 28 March 2006 - 06:38 PM

Thanks, I learnt it from my GREAT Flash teacher at school. I owe him lots. :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users