all groups > flash actionscript > april 2006 >
You're in the

flash actionscript

group:

Basic scipt errors :(


Basic scipt errors :( Damnnationx
4/16/2006 7:26:26 PM
flash actionscript:
Ive desighned a nice flashy Menu system called Mymenu_MCP. in my menu mcp i
have a few layers
actions
graphics animation of menu system up to frame 70
buttons inside buttons i have animation up to frame 70 of buttons_MCP


Problem is no matter where i insert code i cant get the code to work. im lead
to belive i need to insert code in to frame 1 of my actions layer for the
entire Movie clip but no matter what code ive tried i either get errors or it
just doesnt work..

The event i wish to occur is to play frame 1 of MYMENU so that it plays the
menu animation stops on frame 70

Then in a button i presume i need seperate code to do the following Action:
upon clicking button, Goto scene"AboutME" and play frame 1,stop on last
frame-----or if i use another layer called pages instead of scenes for pages i
would need an: goto"MYMENU" frame number say 80 and stop ....

im not sure best wya to get this to work any help apreciated

Re: Basic scipt errors :( kglad
4/16/2006 7:29:50 PM
first, don't use scene info for navigation. label the frames you need for
navigation and use those labels to navigate.

second, is the a stop() on frame 70 of MYMENU (or is it MYmenu_MCP)? you need
to be clear about the exact movieclip name and case (almost always) matters in
flash.
Re: Basic scipt errors :( Damnnationx
4/16/2006 9:16:05 PM
Right Well il describe it better here
i have:
Scene 1 Called MENU it has 1 layer called Actions and 1 layer called MaMenu
only 1 frame
in MaMenu i have a movieclip called MYMENU_MCP
this MYMENU_MCP has 4 layers all with names Title, Graphics Buttons - all the
layers fade in etc over 70 frames.

On frame 70 the clip is at the end and all images, parts are fully viewable

The buttons layer has init a Buttons_MCP (i did this folowing a previous
tutorial im not sure this is a bad way to do it )

now what i got to do is tell the MaMenu layer on homescene to play the
MaMenu_MCP from frame 1 to frame 70 then stop there

at that point i need the Buttons in my Button_MCP to have functionality ie on
clicking each button to be directed to either another Frame within MaMenu_MCP a
frame outside the 1 to 70 bit or a diffrent frame in the root timeline ie HOME
scene timeline..
Does this help? id be glad to send my swf file if it would alow me to get help
with this as its simply for a home site im trying to play with i did the
graphics and animations but using the help system to self teach actionscript is
proveing to be rather difficult..

my email adress is damnnationx@hotmail.com feel free to add me or email me for
further contact...or jus tpost here again..

ps thansk for reply matey

Re: Basic scipt errors :( Damnnationx
4/17/2006 12:00:00 AM
i dont think ive made any sense reading my own post but would be sur eglad if
somebody understands what im trying to do here.
Think i need to make the main timeline the ROOT
then make the menu_MCP play which is inside the 1st frame of the root
timeline
then at the end of the menu_MCP has played to stopon frame 70
At frame 70 of that time line inside my buttons layer of the same movie clip i
need the buttons to do simple onclick events go to pages or frames..

i can make the menu play and stop on frame 70 by adding a stop() to frame 70
But imprety sure that is not the best way to do it as all tutorials tell me to
use frame 1 of the main timeline for script ...
Re: Basic scipt errors :( Damnnationx
4/17/2006 12:00:00 AM
grrr 3 days of pissin around with this and im fed up with stareing at the
output panels errors

from main timeline frame 1 actions: go to the movei clip named " menu in
frame 1 of main time line, play sodding clip and stop on frame 70....that would
be a good start :D doing this as apposed to going to frame 70 in that clip and
using escape st
which i was told was a bad way to go............

Re: Basic scipt errors :( jumanji :-))
4/17/2006 12:47:49 PM
try posting your code, or a link to it.

Re: Basic scipt errors :( kglad
4/17/2006 2:37:50 PM
Re: Basic scipt errors :( Damnnationx
4/17/2006 3:39:22 PM
ok here is a link to my .fla
there is no code on it as i deleted anything that does no work. run the movie
to see what it looks like at the end
main stage with a movie clip in it, inside movie clip is another movie clip
called buttons..
The buttons are not labeled yet as i did not see point in that until i can get
therm to work or atleast 1 button to go to the page or frame i need it to.

what i need done is for movie clip to play up to frame 70 and stop and the
buttos to go to a difrent frame for each page. between frame 70 and 80 i placed
a test pic thing as well

thanks for the help ....i bet its realy frigen obvious too

http://www.damnnationx.com/DamnnationxMENUfinale.fla
Re: Basic scipt errors :( kglad
4/18/2006 2:41:55 AM
here's your corrected file:

www.gladstien.com/new/DamnnationxMENUfinale.fla

the main problem you were probably encountering was trying to define button
actions on frame 1 of your _root timeline for buttons that didn't exist when
the frame first played. you can't define actionscript for objects that don't
exist, yet.

if you check my fix, you'll see i initiated a setInterval() loop to check for
the existance of the first button. if the first button exists, they all exist
and we can therefore define button actions for them.
Re: Basic scipt errors :( Damnnationx
4/18/2006 2:30:40 PM
ohmygod you totaly roxoe Kglad!!!!!!!!!!!!!!!!!!!!1
i now realise why i could not get it to work myself. 1stly i belive its
because you cant actualy tell the movieclip to goto frame in scene and play
from frame and then stop on frame...
Youve used a loop command.. so im guessing that it loops the movie clip until
the buttons movie clip is on. then the script basicly uses a set of statistics
as a function and the other buttons follow it.... im not 100% sure but il be
reading up and al lthe ++ ivar and prety much most of the stuff mentiond in
this script

loopI = setInterval(loopF, 100);
function loopF() {
if (menuMC.menuActive.MenuActive1_btn) {
clearInterval(loopI);
btnNum = 3;
for (var i = 1; i<=btnNum; i++) {
menuMC.menuActive.ivar = i;
menuMC.menuActive.onPress = function() {
_root.menuMC.gotoAndStop(70+this.ivar);
};
}
}
}

i can see where some of it works but some is beyond me atleast im prety sure i
know what i need to make the other buttons work and that would be to simply
add labels to the other buttons....il make a save copy and play abit with it...

Thansk again kglad...
ps what did you think of the graphics? the last fade in of the buttons is a
bit dogy but im working on it, any suggestions?
Re: Basic scipt errors :( kglad
4/18/2006 2:46:26 PM
i liked your graphics. that looks nice.

to add code for more buttons, just change btnNum in the above code and add the
appropriate pages (4,5,6 etc) to the correct frames of _root.menuMC (74, 75, 76
etc).
Re: Basic scipt errors :( Damnnationx
4/18/2006 2:52:02 PM
Originally posted by: kglad
i liked your graphics. that looks nice.

to add code for more buttons, just change btnNum in the above code and add the
appropriate pages (4,5,6 etc) to the correct frames of _root.menuMC (74, 75, 76
etc).

Yehh i just changed btn= 3 to btn=10 and gave those buttons lables like the
1st 3 buttns in the movie clip......and yeh i aded some more frames hehe:D....
i think once ive sorted the crap vertical fadein on the buttons i may try and
add some sound and possibly some nice fade fade out on the actual pages:p.....
Got this picture in my head....But it never quiet comes out the way! ya want
it:D

hmm might be a good signature qoute that:D


Re: Basic scipt errors :( kglad
4/19/2006 1:16:47 AM
AddThis Social Bookmark Button