PDA

View Full Version : Am sure there's a simple solution ...


Ohlins
11-28-2007, 10:39 AM
I'm 90% of the way through a project and I've reached the extent of my Flash knowledge ... the frustrating thing is I know there's probably an easy solution but I can't work it out. Hopefully somebody can shed some light?

I have a main timeline with 12 frames and stop actions on each one. Each frame shows each stage of a menu for a standalone. The menu options change as you progress, ie once you've done section 2, the menu shows section 3 as clickable. The user can only go to the next menu item, but has to be able to go back (so if they get to section 8, they could go back and repeat section 3, but I need section 3 to play and then return to the section 8 menu). I have each section saved as a seperate flash file ... not sure whether to bring them into the main file as external swfs into an empty movieclip or as Scenes?

My second question is, if I do either, when the user wants to go back I need the section to play then return to the current frame on the main timeline. Am not sure I can put all that on one button?

If it wasnt for the fact that users need to be able to go back through sections, i can work it out ... but this has me completely stumped!

emergency_pants
11-28-2007, 10:51 AM
I think you'll be better off loading them into a main movie as external swfs or as seperate symbols in your library and attached from the library at runtime. I avoid scenes as much as possible.

I think with that setup, it would be possible to create some sort of tracking object, which stores which section the user is currently in, and has reached overall.

That way, you can always refer to it whenever the end of a section playback is reached. If the user has reached section 8 and then plays section 3 back again, you can recal that last section and return to it.

If I get time, I'll knock out a quick example, but I'm busy today.

Ohlins
11-28-2007, 11:27 AM
Hey Simon,

Have just laughed lots at your 'today I smell of wee' line on your profile thingy!

Really appreciate your help ... am more of a designer than a developer, but I'm desperately trying to understand more complex actionscript.

A friend of mine has just suggested using alpha changes ...

on (press, release) {
gotoAndPlay(29);
}
on (rollOver) {
TOPRIGHT._alpha = 50
LEFT._alpha = 50
TOPLEFT._alpha = 50
RIGHT._alpha = 50
BOTTOMLEFT._alpha = 50
BOTTOMRIGHT._alpha = 50
}
on (rollOut) {
TOPRIGHT._alpha = 100
LEFT._alpha = 100
TOPLEFT._alpha = 100
RIGHT._alpha = 100
BOTTOMLEFT._alpha = 100
BOTTOMRIGHT._alpha = 100
}

So i dont need to have 12 frames for each movement of the menu, just one, and he says I can use alpha to show the external swfs - on press load clip whatever *alpha = 0. He's tried to describe it to me, but I'm lost already. It sounds like a cool way of doing it though. It's so frustrating having the main elements completed and perfect but not being able to link them all up!

Have attached some jpegs to show how the menu looks/works ... this is going from section 1 to section 2, so at the moment i have each one on a frame. On completion of a section, a huge jigsaw piece starts to show.

Hope this makes sense!

emergency_pants
11-28-2007, 12:13 PM
I prefer to use _visible for setting menu buttons this way, but if you want them visible but 'dimmed-out', you'll need to also set enabled = false;

I've attached an example of what I think you're looking for.

Each section exists in the library and has a linkage identifier. The sections are attached when a menu button is pressed. they attach over each other, on depth 1, so there's no need to remove them again when a new section is selected.

Because all the buttons do the same thing (start a section) I have used for...loops throughout to save time having to script each button individually.

I didn't use an object, just a couple of variables, "numSelectableSections" and "curSectionPlaying". These are all that were needed to set the states of the menu buttons.

I've annotated the script, so hopefully it's easy to see what and why.

Hope that helps.

EDIT: I've added a version which uses _alpha instead of _visible

Ohlins
11-28-2007, 12:32 PM
Awwww WOW!

Cheers Simon! Am well impressed! am away to try this out ... will let you know how I get on :D

One very happy Lins :)

Ohlins
11-28-2007, 01:11 PM
Ahhh slight problemo ...

Your version has the menu in view at all times ... my menu is 800x600 ... so are my swfs ... so i need to be able to hide/loose/unload the swf once it's finished playing to show the menus again :rolleyes:

Must be 95% of the way there now!

------ Now sorted by putting in an unloadMovie function at end of swf