Code In Main Timeline - Buttons Not Working
Ok - think the beer killed a few brain cells - need help...I got a flash file which am coding in AS2.0 and all code on the main timeline.Within a movieclip there is a button on the timeline which I can access from the main timeline, i.e.KPI_mc.new_btn.onRelease = function(){ KPI_mc.gotoAndStop("New");}This then goes onto another part of the timeline with another button called 'save'. But the following code doesn't work. Is there anything I need to do for it to be accessable from the main timeline? KPI_mc.save_btn.onRelease = function(){ trace("hi"); KPI_1 = KPITitle; KPI_1Desc = KPIDesc; //move on to the menu screen KPI_mc.gotoAndStop("Menu");}If I put the save button by the 'new' button it works... Any help?
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 01-03-2008, 07:11 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Code Not Working Unless On Main Timeline..
Never had this issue before.
I grabbed this sliding menu from a flash database and modified it to my need, the entire thing works great while its inside the original file on the maintimeline, but if I put it into another fla or MC it stops working. It only works on the 1st frame of the main timeline. So I tried to have my main movie externally load the SWF, and that didnt work either, the loaded SWF just doesnt react.
I included the FLA below, it was too big to send through Kirupa.
http://www.sheahawton.com/portfoliocontent.fla
Anyone see what I'm missing?
Check Code For Buttons On The Main Timeline... ?
If i have:
10 MC's (myBox1, myBox2, myBox3, etc.) attached from the ilbrary to MC called ART. Each one has a button inside named n1, n2, n3, etc...
On the main timeline i have want to add a code that would validate and when the "correct" button is pressed, trace the appropriate characters.
I've tried putting temp var in the function where i was attaching the movies, but i cant get the correct evaluated result:
The other way is to add code to each button manually but I'm trying to make it all dynamic from the _root timeline using something to this extend.
ART.myBox1.button.onRelease = function() {
trace("zzz");
}
Anyone knows how to do it???
Thanks in advance!
Buttons Within MC Not Working When Referenced On Main Timeline
hi All,
I'm working on this rollover menu and I like to put all of my code on the first frame on the root of the movieclip. Just to keep it all together (one day I learn how import actionscript files....) but the buttons within the roll over movieclip aren't being referenced from the main timeline and I'm pretty sure I've used the correct dot notation. I've attached the file, anyone know how I can solve this and still keep the code in frame 1 of the main timeline?
Cheers,
Daf
Main Mc Loads External Swf, Then Main Swf Buttons Stop Working
I have a portfolio site that I am building. The main site swf has a navigation menu, and a empty movieclip. Each of the buttons on the menu calls up an external swf to load into the main empty mc. When you click on 'home', the 'home' swf loads.. when you click on 'about', the 'about swf loads, I can switch between them, no problem.
This is where my problem comes in... I just created another external swf that has a gallery in it. The gallery consists of thumbnails and a larger image that are calling from an XML file. When this swf loads into the main mc, everything is fine. But then, the buttons on the main swf menu stop working! The buttons all work going between one another, except when you load the gallery and then you can't go anywhere else. Help!
let me know what code you need, if any. MUCH APPRECIATED in advance :)
example of whats happening:
http://christinevanetten.com/index2.html
Edited: 04/18/2008 at 08:30:55 AM by christineski
Getting Code Off The Main Timeline
Hi,
I was wondering if its possible to associate a class with a scene in the same way that its possible to link a class to a movie clip in the library? In doing this I could get all the code off of the main time line.
If this is not possible, then the only other way I can think of doing this is to create a class instance when the scene first loads. The problem here is that the clips on the main time line will not be within the scope of the class instance.
Any ideas here?
Cheers, CN.
Working Out Of Main Timeline And In MC's
Hello,
I've been reading a lot about working in MC's and out of the main line.
I'm starting a new project that will contain several sections (separate .swf files) loaded into MC container/s on the stage.
Right now I'm thinking of staying on one level cause I'm not sure how why I'd need other levels.
Anyway, I'm interested in more information about getting stuff off my maintime and into MCs within MCs.
The sections are easy to conceptualize as .swfs within MCs, but I have a top level nav which is an MC on the maintime and a graphic backgound.
Please guide me to anything discussion I can read about this issue.
Peace,
Manipulating MCs From Code On The Main Timeline
Argh this should be simple but I'm getting unpredictable behavior from my movie.
I have this in a frame on the main timeline:
if (_level4.count == "two") {
with (selector) {
gotoAndPlay(3);
}
}
And then I have a simple 4 frame MC on the stage with an Inctance name of "selector"
Just doesnt work. Do I need more code somewhere like a "onClipEvent" or something? I do this kind of operation all the time from buttons, but it seems to me that there is an issue of timing for operations on the timeline..... I dunno blabble babble........
Help Translating Code From Btn To Main Timeline
Hi,
In this flash movie "movie_mc" plays forwards if user rolls over the button "button_btn". On rollout, the mc plays backwards. I'm using the following code in the first frame of "movie_mc:"s timeline:
ActionScript Code:
stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this._parent.button_btn.onRollOver = function() {
rewind = false;
play();
};
this._parent.button_btn.onRollOut = function() {
rewind = true;
};
Now I need to "translate" this code so that I can put in in the Main timeline. I'm not sure how to that, I would much appreciate your help! If you want to, take a look at the attached Flash file!
Best/
WTK
Rewriting Code For Main Timeline
I've got an MC name "bg" with the following code on it:
Code:
onClipEvent (load) {
var a = 15; // this is the speed of the transition, the higher the value, the slower the fade
myColor = new Color(bg); // this sets up the color object, and sets the other variables to the initial values
var cRGB = myColor.getRGB();
var cHEX = cRGB.toString(16);
var newRGB = cRGB;
var newHEX = cHEX;
}
onClipEvent (enterFrame) {
if (cHEX<>newHEX) {
// break the hex into 3 values, one for each color
var cHEX_r = parseInt(cHEX.substring(0, 2), 16);
var newHEX_r = parseInt(newHEX.substring(0, 2), 16);
var cHEX_g = parseInt(cHEX.substring(2, 4), 16);
var newHEX_g = parseInt(newHEX.substring(2, 4), 16);
var cHEX_b = parseInt(cHEX.substring(4, 6), 16);
var newHEX_b = parseInt(newHEX.substring(4, 6), 16);
// adjust each value independantly, so you don't get any wierd colors showing up
// adjust red value
if (cHEX_r<>newHEX_r) {
var r_diff = Math.round((newHEX_r-cHEX_r)/a);
if (Math.abs(r_diff)<1) {
cHEX_r = newHEX_r;
} else {
cHEX_r += r_diff;
}
}
// then green value
if (cHEX_g<>newHEX_g) {
var g_diff = Math.round((newHEX_g-cHEX_g)/a);
if (Math.abs(g_diff)<1) {
cHEX_g = newHEX_g;
} else {
cHEX_g += g_diff;
}
}
// then blue value
if (cHEX_b<>newHEX_b) {
var b_diff = Math.round((newHEX_b-cHEX_b)/a);
if (Math.abs(b_diff)<1) {
cHEX_b = newHEX_b;
} else {
cHEX_b += b_diff;
}
}
// adjust the color to the new value
// sets the decimal numbers back to hex
cHEX_r = cHEX_r.toString(16);
cHEX_g = cHEX_g.toString(16);
cHEX_b = cHEX_b.toString(16);
// this check is needed if there is a 0 value in the string, when you use toString() it will leave 0's blank,
// instead of filling them in, so you get "0" instead of "00" or "e" instead of "0e" so this fills in the 0
// if it is needed
while(cHEX_r.length < 2) {
cHEX_r = "0"+cHEX_r;
}
while(cHEX_g.length < 2) {
cHEX_g = "0"+cHEX_g;
}
while(cHEX_b.length < 2) {
cHEX_b = "0"+cHEX_b;
}
// end toString() fix
cHEX = cHEX_r+cHEX_g+cHEX_b; // set the current HEX variable
myColor.setRGB(parseInt(cHEX, 16)); // set the color of the BG (or object)
}
}
I've tried removing the code from the "bg" clip and placing it on the main timeline using this sort of syntax: "bg.onEnterFrame = function() { }" but the code doesn't execute so there's obviously something else that needs to be updated for this to work on the timeline. Thanks for the help.
Return To Main Timeline Not Working
I have followed a zillion threads about returning to the main timeline from an swf but can't figure out what I am doing wrong.
I have an external swf loaded into an mc on the maintimeline.
When the sound is finished playing at the end of the external swf I want to return to the main timeline.
My code in the external swf is this:
stop();
mySound.onSoundComplete = function() {
_root.gotoAndPlay ("movie", "explore");
}
(where "movie" is the scene and "explore" is the frame label).
Nothing is happening.
The odd thing is that if I write...
stop();
mySound.onSoundComplete = function() {
_root.gotoAndPlay (1);
}
...it works (it goes to the main timeline, but not to the place I want).
I am going completely mad and really have searched every thread to see what I'm doing wrong. Please help!!!
Trying To Run Code Within A Movie Clip From The Main Timeline
here is the fla file - http://www.grokinfullness.com/example.fla
I am trying to run code that is located in the actions layer of a movie clip from the main timeline. I want to do this because I will have 10 identical movie clips that will all have to be manipulated the same way and I do not wish to have to resort to copying and pasting everything.
In the actions layer of the main timeline I put the following code -
stop();
test_mc.insertText();
In test_mc (located in a separate layer in the main timeline) I put a dynamic text box called myTest_txt and the following code in a separate layer -
stop();
insertText = function()
{
myTest_txt.text = "test" ;
trace( "testy test test" );
}
When this is run "test" should appear in the textbox and you should get the trace. Unfortunately, this does not happen. Any ideas on what I should do to make this work?
Code Works On Main Timeline But Stop After....
I made an mp3 player from gotoandlearn.com and it all work on the main timeline, but when I insert it into an animated movie clip it doesnt work. Anyone know why? I attached my files except the mp3s
Movie Clips Working In The Main Timeline.
I know how to make a movie clip. but what I am confused about is. how do you get the movie clip to animate in the main timeline?
I try just adding the clip by dragging it from the library but it doesnt animate. it just sits there on the first frame of the movie clip.
how do I get it to animate on its own without having to manually do it. because if I do that, what is the point of making movie clips. I am obviously missing some step here. Please advise.
Actionscript Not Working Inside MC On Main Timeline
I posted this elsewhere, this is probably more appropriate...
I know this HAS to have been answered somewhere here before... I've been doing Flash on and off since it's creation, but it's been a while since I used it. I have Flash8 running on this dev machine and I am adding a little accordion to an old project. I have tried calling the accordion swf from the main movie and loading it in, but this is not working for me.
So, I tried copying all of the frames form the external SWF accordion (it's small), along with it's actionscript to a MC inside the main movie and placed that MC on the timeline in the main file. The MC shows up fine, but the action associated with it is not functioning.... basically I want the text button to pop up the accordion MC and allow interaction by the user to click through the slides within it.
A little definition:
KSB_MC = the container MC on the main timeline that displays the first frame of the MC which is: KSBbutton_MC
KSBbutton_MC = the text MC visible from the main timeline that should launch the KSBanimation_MC (which is the accordion)
This is the AS I have so far that is in the MC I placed on the main timeline:
//first we stop both animations inside KSB_MC from running
KSB_MC.KSBbutton_MC.stop();
KSB_MC.KSBanimation_MC.stop();
//then we make conditional, the button action so that if the button_MC is pressed, the button goes to frame 2 and the animation_MC plays or else stop both animations
KSB_MC.KSBbutton_MC.onPress = function(){
if(KSB_MC.KSBbutton_MC._currentFrame ==1){
this.gotoAndStop(2);
KSB_MC.KSBanimation_MC.play();
}
else{
this.gotoAndStop(1);
KSB_MC.KSBanimation_MC.stop();
}
}
.......first of all, the KSBbutton_MC on hover shows a finger cursor as it should, but does not activate when pressed. Nothing happens after that. I get no errors in the AS checker....
my problem is with layering or something st00pyd. Feelin kinda n00bysh.
Help a brothah out will ya guys?
Buttons Within Buttons Not Effecting Main Timeline
i am having problems with a scene i am trying to create.
In the beginning there are a group of buttons on the left that collapse into one button titled Expand. In place of the collapsed buttons a list of text button options appear. All of this is contained in a Movie Clip in my scene.
When rolling over the options I want the user to be taken to different frames on my main timeline
My problem:
The options(text buttons) I have made are controlling the timeline of the Movie Clip they are held in rather than effecting the Main Scene's timeline.
Is anybody familiar with this problem? Maybe I need more action script than
on(rollOver){
gotoAndPlay(23);
}
Thank you in advanced radical people!
Gotoandplay (to Main Timeline) From A Loaded Swf Isnt Working
i haven't done a full on flash site in a couple of years, so im really rusty on my AS.
i have a main timeline movie where i loaded a swf into it through LoadMovie. i'm trying to get a link to gotoandplay a labled frame (test1) on the main timeline and i can't get it to work for some reason.
currently i have it set to:
on (release) {
_root.gotoAndPlay("test1");
}
and it's not working. any ideas?
STUCK AGAIN: Move A 'clipevent Code' Into The Main Timeline 'function' - HELP
I wonder if any on can help me here with this...this is my script that is attached to movie clips which ar erandomly placed on the screen and walk about at random angles and speeds.
-------------------------------------------------------------
-------------------------------------------------------------
onClipEvent (load) {
sx = random(4)+4;
sy = random(6)-6;
if (_name != "ganga") {
_x = Math.random()*750+25;
_y = Math.random()*550+25;
this.gotoAndPlay(2);
}
}
onClipEvent (enterFrame) {
if (_name != "ganga") {
_x += sx;
_y += sy;
// these may not be needed if it never just goes in one direction:
if (sx == 0 && sy<0) {
// just up
this._rotation = 0;
}
if (sx == 0 && sy>0) {
// just down
this._rotation = 180;
}
if (sx<0 && sy == 0) {
// just left
this._rotation = 270;
}
if (sx>0 && sy == 0) {
// just right
this._rotation = 90;
}
if (sx>0 && sy == 0) {
// just right
this._rotation = 90;
}
// directions:
if (sx>0 && sy<0) {
// 9
this._rotation = 45;
}
if (sx>0 && sy>0) {
// 3
this._rotation = 135;
}
if (sx<0 && sy>0) {
// 1
this._rotation = 225;
}
if (sx<0 && sy<0) {
// 7
this._rotation = 315;
}
if (_x<25) {
_x = 25;
if (sy != 0) {
sx *= -(random(2));
} else {
sx *= -1;
}
if (random(2)) {
sy = 2;
} else {
sy = -2;
}
} else if (_x>775) {
_x = 775;
if (sy != 0) {
sx *= -(random(2));
} else {
sx *= -1;
}
if (random(2)) {
sy = 2;
} else {
sy = -2;
}
}
if (_y<25) {
_y = 25;
if (random(2)) {
sx = 2;
} else {
sx = -2;
}
if (sx != 0) {
sy *= -(random(2));
} else {
sy *= -1;
}
} else if (_y>575) {
_y = 575;
if (random(2)) {
sx = 2;
} else {
sx = -2;
}
if (sx != 0) {
sy *= -(random(2));
} else {
sy *= -1;
}
}
}
}
------------------------------------------------------------
------------------------------------------------------------
But what I want to do since i'm using MX is put all this into a function on the main timeline...but i can't get it to work! any ideas anyone...the mc are all on the root.
this is what I created, but as I said it doesn't work:
-----------------------------------------------------------------
-----------------------------------------------------------------
function walkFree() {
if (_name != "ganga") {
for (i=1; i<=amount1; i++) {
_x += _root["ganga"+i].sx;
_y += _root["ganga"+i].sy;
sx = _root["ganga"+i].sx;
sy = _root["ganga"+i].sy;
}
// these may not be needed if it never just goes in one direction:
if (sx == 0 && sy<0) {
// just up
this._rotation = 0;
}
if (sx == 0 && sy>0) {
// just down
this._rotation = 180;
}
if (sx<0 && sy == 0) {
// just left
this._rotation = 270;
}
if (sx>0 && sy == 0) {
// just right
this._rotation = 90;
}
if (sx>0 && sy == 0) {
// just right
this._rotation = 90;
}
// directions:
if (sx>0 && sy<0) {
// 9
this._rotation = 45;
}
if (sx>0 && sy>0) {
// 3
this._rotation = 135;
}
if (sx<0 && sy>0) {
// 1
this._rotation = 225;
}
if (sx<0 && sy<0) {
// 7
this._rotation = 315;
}
if (_x<25) {
_x = 25;
if (sy != 0) {
sx *= -(random(2));
} else {
sx *= -1;
}
if (random(2)) {
sy = 2;
} else {
sy = -2;
}
} else if (_x>775) {
_x = 775;
if (sy != 0) {
sx *= -(random(2));
} else {
sx *= -1;
}
if (random(2)) {
sy = 2;
} else {
sy = -2;
}
}
if (_y<25) {
_y = 25;
if (random(2)) {
sx = 2;
} else {
sx = -2;
}
if (sx != 0) {
sy *= -(random(2));
} else {
sy *= -1;
}
} else if (_y>575) {
_y = 575;
if (random(2)) {
sx = 2;
} else {
sx = -2;
}
if (sx != 0) {
sy *= -(random(2));
} else {
sy *= -1;
}
}
}
}
------------------------------------------
-----------------------------------------------------
this is called from in the on clip event within the mc's they also have the top part as there onclipevent load:
----------------------------------------------------------------------
onClipEvent (load) {
sx = random(4)+4;
sy = random(6)-6;
if (_name != "ganga") {
_x = Math.random()*750+25;
_y = Math.random()*550+25;
this.gotoAndPlay(2);
}
}
onClipEvent (enterFrame) {
walkFree;
}
------------------------------------------------------------------------
please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!STU
Buttons Function Only On Main Timeline?
it seems that whenever I place a button inside of a MC and then place it on the mainstage, it never works.
once I take the button outside of the MC and just place it on the main timeline, it works. However, this can be mildly inconvenient to the organization of my movie.
why is this? is there a way to get it to work inside of a MC?
thanks.
[F8] Main Timeline From Buttons Inside Mc's
OK, so I'm teaching myself actionscript. doing alright, running into frustration.
I've created drop menu's with each option as an individual button inside a movie clip on the main timline. All I want to do is control which frame on the main TL the scrubber goes to when the user releases on the buttons. This can't be that hard, but I can't figure it out. I've got three different books, one of which is "actionscript, definitive version" and hell if I can find anything that expains how to do this.
I understand I need to somehow call out the "_root", but every combination of code I can think of, or read from will not work.
All my different pages for the site are located in seperate frames on the main TL. All the animation is located in mc's on the first frame of each layer (seperate layer per interface component, btn's, bkgrnd, ect...) Everything is working like a dream with actionscript btw animations, but nav's are killing me.
please help.
[CS3] Nested Movie Clips Affecting Main Timeline, Not Working
i have a movie that shows a series of full-size images in succession, but also have a scrolling thumbnail bar below it that i want to be clickable for people to jump to another image if they want. i've got the full-size images working, the scrolling thumbnail bar is working, and i have the buttons in the thumbnail bar connecting to the main timeline where the full-size image movie clips are played, but it's just not working correctly. when i click on the one thumbnail that is currently linked, it will work once or twice and then the second or third time just show a blank 'screen' in the full-size area.
the demo of it is here:
http://beta.candyteria.com/
the .fla is here:
http://beta.candyteria.com/site_reso...me_flash_2.fla
any help would be hot...
How Do You Link Buttons In An Mc To Frames In The Main Timeline?
Hi all,
Thanks for the interest in my post.
I have a series of 6 animated buttons in a movie clip in Flash 5 (each button has its own layer). I want to link the buttons in the MC to frames in the main timeline.
Can somebody please help me by telling me what action script I have to assign to the buttons in order to link them to frames in the main timeline please.
Thank you very much.
Take care all,
Mark
Forward And Back Buttons On Main Timeline
I have a forward button and a back button on the main timeline.
I want the FORWARD BUTTON to jump 20 frames each time you press the FORWARD button, which needs to control the main timeline.
Also, I would you do this for a BACKWARD BUTTON?
Can some please help.
Thanks.
Buttons In Moviclips. Can They Control The Main Timeline?
does anyone know of any actionscript that can be applied to a button that is
IN a movieclip so it can navigate the main timeline INSTEAD of just the mov
ieclip's timeline?
I've tried applying this script to a button in a movieclip:
on (press) {gotoAndPlay("scene1","1");
}
this doesn't seem to navigate the maintimeline at all though.
I would really appreciate any help
(tricky) Accessing Buttons From The Main Timeline
I am trying to load images externally with the loadMovie function. The actionscript is on the main timeline and i use:
this.tabs_mc.zerofive.but1.onRelease = function() {
infoField._visible = true;
startLoading("pix/2005/2.jpg");
so far it has worked perfectly.
on the next bit i want to put the same code on a button (but14) in a movieclip (zerosix) on the 2nd frame of the tabs_mc.
I think it should be tabs_mc.zerosix.but14.onRelease....
but alas it does not work.
Accessing Buttons In External Swf From Main Timeline
Hello,
I am loading external swfs into a main swf. So I have main.swf which loads menu.swf, along with ssp_home.swf and home.swf.
These all load at the beginning.
I also have two other swfs - transition.swf and writing.swf - and when you click on the writing button in the menu.swf I want to load the transition, followed by the writing.swf into the main timeline.
I am really struggling - how to you tell a button in menu.swf to do load something into main.swf from main.swf?
Thanks and best wishes,
Nested Buttons Not Talking To Main Timeline
Can anyone tell me why this code is not working? Basically I am trying to get buttons that I have in a drop down menu load an external .swf into an empty movie clip placed on the main timeline. However for some reason it is not working. The buttons are contained in a movie called "menuItems" which is then placed in a movieclip called "mainMenu" which is then placed on the main timeline.
on (release) {
_parent.gotoAndPlay("reverse");
if (_root._root._root.currMovie == undefined) {
_root._root._root.currMovie = "personalData";
container.loadMovie("personalData.swf");
} else if (_root._root._root.currMovie != "personalData") {
if (container._currentframe >= container.midframe) {
_root._root._root.currMovie = "personalData";
container.play();
}
}
}
Nested Buttons Not Talking To Main Timeline
Can anyone tell me why this code is not working? Basically I am trying to get buttons that I have in a drop down menu load an external .swf into an empty movie clip placed on the main timeline. However for some reason it is not working. The buttons are contained in a movie called "menuItems" which is then placed in a movieclip called "mainMenu" which is then placed on the main timeline.
on (release) {
_parent.gotoAndPlay("reverse");
if (_root._root._root.currMovie == undefined) {
_root._root._root.currMovie = "personalData";
container.loadMovie("personalData.swf");
} else if (_root._root._root.currMovie != "personalData") {
if (container._currentframe >= container.midframe) {
_root._root._root.currMovie = "personalData";
container.play();
}
}
}
Controlling Main Timeline From Movie Clip Buttons
Hello,
I have a drop down menu that is a movie clip, when you mouse over it, It drops down and 5 buttons are displayed. So when i put action scipt in it to make the main timeline go to a different flag, It doesn't work. this is what i have tried so far.
Code:
on (release) {
gotoAndPlay("_root", "dorms");
}
Code:
on (release) {
gotoAndPlay("Scene 1", "dorms");
}
Code:
on (release) {
gotoAndPlay("dorms");
}
Anybody help me
Buttons Within Movie Clips, Targeting The Main Timeline
I have five buttons (1-5), in a movie clip (MC1). I want the buttons to go to frames on my main timeline--NOT within the MC1, but I am having a problem with it.
Currently I use:
on (Press){gotoAndPlay(frame);}
but this plays the frame within the movie clip, not on the main timeline.
I am sure there is a simple solution to this. Any help would be greatly appreciated.
Thanks,
shotbot
Controlling The Main Timeline With Buttons In Movie Clips
alright i have some buttons in a movie clip as a navigation bar, and i have no clue how to get it to work on the main timeline. i can control the movie clip with the main timeline, but not the reciprocal...some help would be greatly appriciated or however you spell it.
P.S.....im hot.
Loaded Swf With Buttons Not Communicating With Main Movie Timeline
hi
i have a swf that i load into a level in the main movie that contains my menu. i want to use the buttons in this movieclip to navigate to different frames in my main movie (which loads other movieclips on different levels)
the buttons are themselves in movieclips but this doesn't seem to be a problem when i have the whole menu in a movieclip in the same movie, not loaded externally.
i've tried using
Code:
on (release) {
_root.gotoAndPlay(40);
}
which works in the same movie, but not when i load the movieclip into the main movie.
Is it because i'm loading the movieclip into layers rather than a container?
i know i'm probably making some huge mistake so any help whatsoever will be greatly appreciated.
thanx
Duswa
Pause And Play Buttons To Control Main Timeline?
i have multiple "scenes" with no movie clips in them. i would like to add 2 buttons (one to pause and one to play) to control the timeline throughout the piece. how do you create buttons that control a timeline that is not a movieclip???
XprtHelp: Buttons In Mc Linked To Labels On Main Timeline?
I am making a very simple site with one timeline. This seems so simple but it isn't working: i created a mc that contains several buttons with over states. I placed the mc in my navigation menu with an invisible button to close it when user's mouse moves off. Where do I link the buttons in this movie clip to labels on the main timeline? It seems like I should select them in the mc, and use gotoandStop on that label. But when I click them in testing the movie, they don't work. I posted the (very) unfinished swf to my url: jkbeasley.com
Can anyone help? I am sitting here alone with no experienced flashies to ask, and I hate when something so easy just will. not. come. to. me!!! THANKS!!!!!!!
K
Buttons In Movie Clips Controlling Main Timeline
Greetings
Ive been having problems getting buttons within a movie clip to control the main timeline and switch scenes. Ive tried everything from _root.gotoAndPlay to with(_parent) and such. If anyone has any tutorials or hot fixes for this please post.
Movieclip Buttons, Controlling Movie From Main Timeline...
I have some buttons inside a m.c., and I when you click on these buttons they load external swf's. Now, I am trying to place all the code for these buttons on the main timeline instead of inside the m.c.
I tried a few things--
partc_btn.onRelease = function(){
loadMovieNum("partc.swf", 1);
}
medicareBTN_mc.partc_btn.onRelease = function(){
loadMovieNum("partc.swf", 1);
}
any suggestions????
thanks,
hutch
Loading External Swfs With Buttons (that Are Not On Your Main Timeline)
I found my problem. I just don't know how to target it. I'm trying to load an external swf, when releasing a button. The problem is the button is not on the main timeline, but instead nested in a movie clip. I just don't know how to target that button. I tried loading the swf with a button on my main timeline and it worked, so I know the problem is not with the movie clip loader class or the actual swf itself. I actually learned this from a note midway down the page in one of your tutorials..... http://www.kirupa.com/developer/mx2004/transitions2.htm
how can i target that button that is nested in that movie clip?
here's my actionscript btw
var myMCL:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
artbar_mc.artBtn_1.onRelease = function() {
myMCL.loadClip("art_1.swf", "container_mc");
};
any help is much appreciated!
Buttons In Movie Clips Controlling Main Timeline
Greetings
Ive been having problems getting buttons within a movie clip to control the main timeline and switch scenes. Ive tried everything from _root.gotoAndPlay to with(_parent) and such. If anyone has any tutorials or hot fixes for this please post.
Having Touble With Buttons Calling On Certian Movie Clips In The Main Timeline
Hi, This is my first time here, and i am here because i have just about given up on this problem i am having. Went through all the books and boards and still havent found the answer. Its kinda a specialized problem i guess. I am using Flash MX, and basically on my main timeline i have some static items like the background that starts on frame one in which i have a stop() to stop the timeline from starting upon opening the movie. The reason i have this is because at the bottom of the screen in the main timeline i have 5 buttons.Now in the main timeline i have 5 movie clips all placed in different frames of the timeline. so movie 1 is frame 2 to frame 11 and movie 2 is from frame 12 to frame 35 and so on with the rest. Now what happens right now is when i test the movie i click on the button that displays the first movie clip in the timeline and it plays it just fine but the problem is it also plays the other movie clips placed on the other frames proceeding the first one. So how do i script it so that each button plays its specified movie clip then stops and returns to frame 1 of the main timeline, instead of going through all the movieclips and then returning to frame 1. Oh ya and each movie clip in the main timeline is on its own layer.
Anyone that can help me, THANK YOU in advance, so so much!!
Until later
AnimatriarcH
Hover Captions On Main Timeline - Problems Addressing Nested Swf Buttons
Hi,
I have a problem where Kirupa's http://www.kirupa.com/developer/mx20...r_captions.htmhover caption code works when it is on the main timeline for buttons that are also on the main timeline. However i cannot make it address the buttons in the nested SWF named "Pictures".
I am very new to Actionscript and I have tried every variable that I can think of... _root / this / _parent etc... trying to get the code to recognise "button1" inside the swf which is loaded in Frame 59 called "Pictures". Button1 appears on Frame 4 inside the Pictures SWF but I do not know the code to reference this from the main timeline such that the hover caption works of this button...
I believe that the firstly i need to address the button somehow?
Code:
button1.onRollOver = function() {
captionFN(true, "Portes du Soleil", this);
this.onRollOut = function() {
captionFN(false);
};
};
Also there must be something that I have to do to the main code to load teh hover...
Code:
captionFN = function (showCaption, captionText, bName) {
if (showCaption) {
_root.createEmptyMovieClip("hoverCaption", this.getNextHighestDepth());
cap.desc.text = captionText;
cap._width = 7*cap.desc.text.length;
cap._alpha = 60;
//
if ((bName._width+bName._x+cap._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = _root._xmouse+xo;
cap._y = _root._ymouse+yo;
cap._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap._visible = false;
}
};
Please help...
I have attached the file...
BTW: This is a Flash MX 2004 related issue...
Charlie
[CS3] Please Help...Code In Main Accessing Mc Buttons
Hello... I need some help. Trying to get code placed in first frame of main timeline to access MC instances inside a movie clip thats placed on the stage. Buttons work if placed directly on stage but not if they are with a movie clip. I need to access the ones in the movie clip as I have multiple frames in the movieclip with different groups of button. Please help! Link to .fla is http://www.householdergrouprealty.com/test/ file is buttonscript.fla.
main code is:
// create a variable to track the currently selected button
var activebtn:MovieClip;
// create an array of all nav buttons in group
var groupinfo:Array = [mcb1, mcb2, mcb3, mcb4, ptb1, ptb2, ptb3, b1, b2, b3, b4];
// doRollOver: start the rollover action,
// unless the button is currently selected
function doRollOver() {
if (this != activebtn) {
this.gotoAndStop("btnover");
}
}
// doRollOut: start the rollout action,
// unless the button is currently selected
function doRollOut() {
if (this != activebtn) {
this.gotoAndStop("btnoff");
}
}
// doRollOut: start the rollout action,
// unless the button is currently selected
function doPressDown() {
if (this != activebtn) {
this.gotoAndStop("btndown");
}
}
// doClick: 1) save a reference to previously active button, 2) update activebtn,
// 3) turn off previously active, 4) turn on current active, 5) change bottom content
function doClick() {
var prevbtn:MovieClip= activebtn;
activebtn = this; // update pointer to current selection
prevbtn.onRollOut(); // return previously selected to normal
this.gotoAndStop("btndown"); // change appearance of selected mc
}
// assign functions to each event for each button in the group
function init() {
for (var mc in groupinfo) {
groupinfo[mc].onRollOver = doRollOver;
groupinfo[mc].onRollOut = doRollOut;
groupinfo[mc].onPress = doPressDown;
groupinfo[mc].onRelease = doClick;
}
}
init();
Buttons In Movie Clips Return User To Specific Frames On Main Timeline
Hi
I'm fairly new to Flash 5 and have a problem / query I was hoping someone out there could help me with.
I have several movie clip symbols on specific frames on my main timeline. At the end of the first movie clip's timeline I'd like the user to be able to click a button within the movie clip which will return them to a specific frame on the main timeline, and therefore start playing a different movie clip symbol.
Is this possible... and if so how's it done??
Thanks in advance!!
Buttons Are Not Working After Timeline Stops
Hello,
I have 5 buttons linked to 5 scenes using the GotoandStop, frame label, stating each scene. Using each scene as a seperate page in my movie.
When I do "test movie" I can click on each button to get me to the next page before my timeline finishes playing in my main page. But when my main pages timeline stops, they won't link to the pages?
Since I want to keep all pages in one .fla file, am I doing this correctly? (using Flash MX)
Thank you
Thorrax
Buttons Inside Scrollpane Not Working In Main Movie It Is Loaded Into
Caio rigazzi,
I have a scrollpane with a movie that contains a movie clip in it. That movieclip contains buttons which are capable of bringing up a pop-up menu and should display a sample image when "rolled over". The problem is when I use :
on (rollOver) {
_root.rollover.gotoAndPlay ("1FLUX");
}
on (rollOut) {
_root.rollover.gotoAndPlay ("1BACK");
}
The "roll over" function does not work in the main movie this scroll pane is loaded into.
Basically, the scroll bar in a swf named VIDEO, is loaded into a DESIGNWORK1.fla, which is loaded into a main video: INDEX12
(courtesy of the Transitions between External SWFs( 1, 2)
How can I get this scroll bar to work?
aswg
Buttons Actions On External SWF's Not Working When Loaded Into Main Movie
Hello,
Sorry to post 2 in a row, but they are different problems. Here is my problem:
I have a main menu that is set up like Kirupas smooth transition between external .swf tutorial. Everything loads smoothly. The problem occurs when the external .swf loads, the buttons on that .swf do not function. If you could take a peak at the 2 .flas I have them posted at this address, as they are too large to post! Thank you very much!
http://www.ryanhohman.com/problem.zip
[F8] Buttons Code Not Working
hello, i've got 13 buttons in timeline_mc, labelled date1_btn to date13_btn. i am trying to use this following code to send the playback head to gotoAndStop on the frame label that corresponds to the date number in another mc: eg.. date1_btn sends playback head to "date1" label in the blurb_mc located in the timeline_mc. i have used this code from another fla i worked on, but i dont really understand why its not working this time, any help would be greatly appreciated. thank you
Code:
stop();
for (var n = 0; n != 14; n++) {
dateBtns(n);
}
function dateBtns(num) {
_root.timeline_mc["date"+num+"_btn"].onRollOver = function() {
trace(num);
_root.timeline_mc.blurb_mc.gotoAndStop("date"+num);
};
}
Buttons Working Even With No Code
Hi all,
My problem is this. I've got some code that creates a dynamic photo gallery. When you click a thumb, the big pic changes and so does its label. Well, the label isn't changing but the full size is. Now here is the wierd part. when I take away the code, the thumbnail button still works. There are no duplicates, because when I remove the as that attaches the button, nothing happens. Anyone experience anything like this? Thanks.
Help With Pop Up Menu (Sub Menu Buttons) Linking To Frame On Main Timeline
Hi,
I really need help with my flash project. I've created a pop up menu by having 4 buttons on the main timeline which I made into a movie clip which has an instance name of menu_mc. Inside that movie clip I have my sub menu created and the menu works great. My only problem is that I can't seem to link the submenu buttons to the frames created on the main timeline. I've tried all the action script I can think of. One example I am using is
menu_mc.contact_btn.onfiltered= function() {
gotoAndStop("Scene 1", "contact");
}
This is where I am trying to link the Contact Button (which is a submenu button of the About button) to the contact frame which is located on the main timeline. Please help me if you can. Thanks.
Referencing Clips On Main Timeline From My Main Document Class
Hi All,
I'm trying to reference clips on the main timeline either in or via my main Document class, but if I declare any clips as public in the class body as I would have done is AS when linking an external class, I get:
Code:
1151: A conflict exists with definition tfLength in namespace internal.
If I don't declare the clip, then I can reference it from within the same class with this.tfLength, but other classes complain it the Document classes tfLength variable doesn't exist!
So how do I reference a clip on the timeline in my class?
Thanks,
Dave
|