OO Code And Movie Clips On The Timeline
My group builds apps by creating movie clips which are precisely positioned on the timeline and adding an action to the first frame of the movies' timelines to include external Actionscript files to define properties and functions. This works fine for building self contained objects, but doesn't seem capable of taking advantage of object oriented design principles, like inheritance. Ideally, I would like to build objects, like cars and bicycles for instance, and have both inherit code from a parent vehicle class. Any suggestions on how I can do this given the movies are already instantiated on the timeline?
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 10-18-2005, 06:04 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Hiding And Showing Movie Clips Via Timeline Code
Alright, i need to hide a movie clip on a certain frame on the timeline, and I need it to show again on another part of a timeline. The movie clip is called key. Sure i could use this code:
Code:
onClipEvent(enterFrame){
if(hitTest(_root.char)==true){
_root.inventory.gotoAndStop("key");
this._visible = false;
}
}
But I need to be able to do it on the timeline. How do I do so?
Changing From Embedding Code In Clips To Doing It On The Timeline.
Hello there.
Like a lot of less advanced users, the changes between AS2 and AS3 are causing me no end of frustration. Being more of a designer than a programmer, I've always handled Actionscript by applying actions directly to the clip, thus I have no experience with listeners and frankly have absolutely no idea how they even work.
The technique laid out in this tutorial is one that I've frequently used in projects in the past. However, due to it's reliance on applying code to the object itself means it doesn't work in AS3.
So I'm wondering how the code here changes in order to work with AS3, clearly it would involve listeners but sadly I'm completely at a loss as on how to use them.
Any help would be appreciated. Thanks in advance.
Code On Clips Prevents Timeline Based Tweening
Hi there!
This is an interesting one, but it has been driving me crazy all day today building my band's web site!
Check out http://www.heavenstobetsey.com and don't mouse over any images...
Then mouse over the images and you will see that the background moves and there is a swapDepths being executed...now click on another button and you will notice that the images that have been rolled over now do not tween out!
I have attached the stripped out versions without graphics so they don't exceed 500kB - if anyone can tell me where I am going wrong that would be great! I'm not really a code monkey but I thought that I was using best practice! I am using mc_tween as well...i forgot to put the .as file in the zip but I am sure whoever looks at this will have it or can get it via Google!
I can recode it all so there is no tweening (all mc_tween driven) but would like to find out what (if anything) I am doing wrong before I do!
Ta muchly as always!
AndyT
Please Help With Movie Clips And Timeline
I am creating a flash file with 4 movie clips. I don't know how to control them on the timeline. Here's what I want to do.
1. I want to start the flash movie out with MovieClip1 and have this clip loop throughout the whole flash movie.
2. I want to then have MovieClip2, 3, and 4 play one after the other each one stopping after it has played.
I am new to all this, so please be specific with instuctions on actionscripts.
Thank you!!
Movie Clips Timeline
I have 3 movie clips that are on seperate layers in my main timeline. Each move is 165 frames long. I want to place them so that when one finishes playing, the next one begins and so on.
The problem is that I can't get it to work that way except by dragging each MC layer out 165 frames. I want to keep my main timeline relatively short and thought there would be some kind of action script that I could use.
I tried using a "stop" action at the end of each clip layer on my main timeline; however, I don't know how to get the playhead to progress past the "stop" action.
[AS3] Run Code End Of Movie W/o Timeline Code?
Super noob question on AS3. I'm told that I'm to avoid putting any code in the timeline and use classes instead. I have a simple logo running in the beginning it has no timeline code. How do I make it so that it will call a function when the movieclip is finished playing?
Thanks!
Movie Clips And Main Timeline
When scrolling through the main timeline, I am only able to view the
first frame of each movie clip I've inserted (my layers are made up of
movie clips with no other objects in the main timeline). These views
change with each keyframe, but leave me with an inaccurate
representation of what is happening as I drag the slider across the timeline. I am able to view the outline of
the shape in the movie by clicking the view outline box next to the
lock, but this still does not show me what is going on in the movie
frame by frame. Is this normal, and can it be
changed?
Also, if I want to export only part of the movie for test, is this
possible?
Any help would be most appreciated.
Help Movie Clips Don't Play In Timeline
hey guys,
I'm designing a movie with some simple animation in the timeline. On the last frame ( frame 100), I inserted a movie clip that contains 50 frames worth of animation. When I press enter and play the timeline, the cursor stops at frame 100 and only shows what's in the first frame of the movieclip.
If however, I insert a frame at frame 150 of the movie on the main timeline, the movie clip plays when I "test movie".
This can't be the way it's done! How am I supposed to design a movie if I can't preview what the user is going to see in my timeline? Adding blank frames to to the timeline in order to compensate for the length of the movie clip seems crazy.
Please help me! How does one work with movie clips in such a way as to allow their preview within the timeline. I'm kinda confused, please help clear my head on this one.
Thank-you very much!
Artane
Pause A Timeline/movie Clips
Hey everyone,
I am creating a slideshow presentation in flash, I have a previous/pause/play/next buttons. I am having a problem getting the pause button to function properly, here is what I am trying to achieve. I want to stop all movie clips and timelines when the pause button is pressed. (the control buttons are in a movie clip that sits on the main timeline) Is what is the best approach to achieving this?any links or advice would be greatly appreaciated.
Thanks,
-Jeff
[MX] How Do You Controlling A Timeline Using Movie Clips?
Hello everyone, I was making a drop-down menu movie clip for my flash game. So I made all the features of the drop down menu movie clip, but when I added the script in the button inside the drop-down movie clip, the buttons wouldnt take me to the main scene!
This is the script I added in the button which was in a movie clip, (I am trying to make the button let the user go to the main timeline and scene "Account", label "RK Theatre".
on (press, release) {
gotoAndStop("Account", "RK Theatre");
}
But whenever I click the button inside the movie clip in "Test Scene", the button does nothing and doesnt bring me to the "Account" and label "RK Theatre" scene.
Help would be great, thanks because I have tried everything to make it work and it won't.
Controling Movie Clips Timeline
I have a movie clip of a meter that movies when a song is being playing. I have a timeline in this movieclip with frame 1 showing movement, and frame 5 showing just a static image.
How do I interact with it from the main timeline? What I tried was meter_mc.gotoAndStop(5);
This didn't seem to do it though.
Help Movie Clips Don't Play In Timeline
hey guys,
I'm designing a movie with some simple animation in the timeline. On the last frame ( frame 100), I inserted a movie clip that contains 50 frames worth of animation. When I press enter and play the timeline, the cursor stops at frame 100 and only shows what's in the first frame of the movieclip.
If however, I insert a frame at frame 150 of the movie on the main timeline, the movie clip plays when I "test movie".
This can't be the way it's done! How am I supposed to design a movie if I can't preview what the user is going to see in my timeline? Adding blank frames to to the timeline in order to compensate for the length of the movie clip seems crazy.
Please help me! How does one work with movie clips in such a way as to allow their preview within the timeline. I'm kinda confused, please help clear my head on this one.
Thank-you very much!
Artane
Movie Clips On Main Timeline
HI! I'm using Flash MX and I'm not very good at it. So I would appreciate your help! Anyway, I'm making a movie w/ no interactivity and I want to put a series of movie clips on the main time line, each to play after the previous movie clip is done. The only way I can make it work is to put the movie clips in keyframes and then allow all all the frames for the movie to play. My movie is way too long and I know there has to be a better way! I'm trying to figure out the action to assign to the keyframe that will play the movie clip within that one frame and when it's done, go on to the next movie clip. Is that possible?
Thanks to anyone who can help!
Removing Movie Clips From The Timeline With AS 3.0
Try this test:
Creat a new Flash movie with 2 bank keyframes.
Draw a rectangle on the first frame, convert it to a movieclip and give it an instance name of testSym
Add this code to the first frame:
////////////////////////////
removeChild(testSym);
testSym = null;
/////////////////////////
and then this code to the second frame:
//////////////////////
trace ("FORCING GC");
try {
new LocalConnection().connect('foo');
new LocalConnection().connect('foo');
} catch (e:*) {}
stop();
// this forces the garbage collector but is not recommended for published products
///////////////////////
give the rectangle movie clip 2 blank keyframes too. Put this code in the first frame:
///////////////////
trace("I'm still here");
/////////////////////
and this code in the second:
///////////////////
gotoAndPlay(1);
///////////////////
Now run the movie - I assumed that the clip would be marked for garbage collection and collected by the forced collect, but it still persists - presumably because it was put statically on the timeline?
Is there any way around this? Surely there must be a way to remove movie clips that have been placed statically on the timeline at design time rather than adding everything using code? Can anyone help?
Help Movie Clips Don't Play On Timeline
hey guys,
I'm designing a movie with some simple animation in the timeline. On the last frame ( frame 100), I inserted a movie clip that contains 50 frames worth of animation. When I press enter and play the timeline, the cursor stops at frame 100 and only shows what's in the first frame of the movieclip.
If however, I insert a frame at frame 150 of the movie on the main timeline, the movie clip plays when I "test movie".
This can't be the way it's done! How am I supposed to design a movie if I can't preview what the user is going to see in my timeline? Adding blank frames to to the timeline in order to compensate for the length of the movie clip seems crazy.
Please help me! How does one work with movie clips in such a way as to allow their preview within the timeline. I'm kinda confused, please help clear my head on this one.
Thank-you very much!
Artane
See Movie Clips In The Main Timeline?
Is it possible to view the position of elements in the main timeline that are held within a movie clip. For example all elements must be at frame one in order to see the movie content. If A space was given in the movie clip, we would not be able to see the position of elements, hope all this makes sense, but is it possible.
I have navigational buttons held within a movie clip. The buttons come with a animation, and start at frame three in the movieclip, except I need to position this acurately with the rest of my design, but dont have a visual for this.
Hopefully someone can explain.
Trev
Movie Clips On Main Timeline
HI! I'm using Flash MX and I'm not very good at it. So I would appreciate your help! Anyway, I'm making a movie w/ no interactivity and I want to put a series of movie clips on the main time line, each to play after the previous movie clip is done. The only way I can make it work is to put the movie clips in keyframes and then allow all all the frames for the movie to play. My movie is way too long and I know there has to be a better way! I'm trying to figure out the action to assign to the keyframe that will play the movie clip within that one frame and when it's done, go on to the next movie clip. Is that possible?
Thanks to anyone who can help!
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.
Playing Movie Clips One After Another On Main Timeline
Hi,
I have a series of movie clips that I'd like to add to the main movie timeline, all on separate layers. I want one clip to play after another, as opposed to having them all play at the same time...Do I need to write some code to allow that to happen?
For example, I'm creating a mini movie, with opening credits, ending credits and everything in between. Each segment is an individual movie clip. I dragged an instance of each clip onto the main stage, separate layers, all on frame one. I'd like for the clip in layer one to play first followed by the next clip in layer two, etc.
Please Help
Thanks
Buttons That Control Timeline In Movie Clips..
I am well able to control my main timeline with buttons, but what I am trying to do is control the timeline in a certain movie clips..
For example there is a shoe and I have 3 different elements (laces, leather and sole) and I would have a 3 corresponding buttons that would change the colors for each shoe element.
Thanks for the help!
Im a newbie here!!!
[CS3] Targeting Multiple Movie-clips From Timeline
Hi there,
Probably a dumb question but I want to target a bunch of different movie clips instances from the main timeline. Basically I have an enlarged pixel that when rolled over becomes more opaque. I have one of these set up and named "pixel". I want to duplicate this on the stage so I have around 100 odd but want to target all of them with the same code. Something similar to this:
this.pixel.useHandCursor = false;
this.pixel.onRollOver = function() {
pixel.gotoAndPlay(2);
}
this.pixel.onRollOut = function() {
pixel.gotoAndPlay(11);
}
Hopefully someone can help.
Cheers in advance,
James
How A Button Communicates With A Movie Clips Timeline?
On the main timeline I have a button and a movie clip. The movieclip has an instance name of "contentArea". When you click the button, I want to gotoAndPlay frame 20 of my movieclips timeline. I can't seem to figure how to write that AS. Please help!
I would think the AS would go something like this (this obviously does not work though)
ActionScript Code:
on (release) {
contentArea.gotoAndPlay(20);
}
Thanks for the help!!
Movie Clips Stop In Main Timeline
I have a movie clip with 100 frames that I have placed in the main timeline (3 frames for a preloader). The move clip is longer than the main timeline and stops. How do I get longer MC's to play?
How Can I Stop All Movie Clips In The Main Timeline?
How can I stop all MovieClips in the main timeline?
The movieclips in the main timeline include those loaded via loadMovie() or loadClip().Can I stop all those externally loaded movieclips, including those embedded in the loaded movieclips?
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.
Complex Amins -- Use Movie Clips Or Main Timeline?
Hello everyone, I'm hoping someone can offer some advice--
I am trying to make a complex animation sequence. At the same time, I want to include a sound on/off button. The instructions for the sound on/off button I have seen so far say to make a sound movie clip and a button movie clip and place them in the 1st frame of the main timeline. So I have done that sucessfully. But, testing has indicated that I can't build out animations in the main timeline without causing glitches in the on/off audio process. Is that right, or is there a workaround for this?
If so, then my option is to build my animation sequence as a MovieClip Symbol. I could do this, but the MovieClip Symbol workspace does not correspond to my actual movie dimensions -- so I feel like I am working 'blind' while in the movie Clip mode. Any suggestions? Thanks!
Consecutive Movie Clips On The Same Frame (main Timeline)
-flash movie has 1 frame with about 10 layers.
-on each layer there is a 10-frame movie clip
-after one movie clip, I want another movie clip on another layer to play.
-the other mc "instance" is named "mc02"
-on that 2nd mc, it starts with a stop() frame so it doesn't play right away.
-the 2nd frame is called "start01"
-here's the action script on the last frame of the 1st MC :
stop();
_root.mc02.gotoAndPlay(start01);
I thought this would work, but it doesn't...any help greatly appreciated!
Thanks in advance....
md
[F8] How To Open Three Movie Clips In A Clip In A Timeline By Button?
I have this in the main timeline:
Code:
var flashArray = new Array("flash/hockey.swf","flash/baseball.swf","flash/armenair.swf");
for(var i=0;i<=flashArray.length-1;i++){
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
loadMovie(flashArray[this._name.slice(3,4)], content);
}
}
the problem is that I don't know how I'm going to include the middle "mc" (from the hierarchy) before the mc1, mc2, or mc3.
See attachment below for the hierarchy structure.
[F8] Scoping / Path From Movie Clips To Main Timeline
I've got a interactive movie that let's a user choose different combinations to customize an item. Each category is it's own movie clip (a total of five movie clips) with buttons that update it's own dynamic text box with a value. This works fine...
On the main timeline, there's a "total" dynamic text box with a "calculate" button that is supposed to get the sum of each value from all five of the dynamic text fields within the movie clips. It worked when everything was in the same movie, but now that the dynamic text boxes are broken up into separate movie clips, I'm not getting anything in the main movie's "total".
From what I understand, it's something to do with setting the right path... How can I fix the code?
Here's what I currently have on the "calculate" button in the main timeline:
on (release) {
total.text = Number(a.text) + Number(b.text) + Number(c.text) + Number(d.text) + Number(e.text);
}
Thanks
How To Open Three Movie Clips In A Clip In A Timeline By Button?
I want this structure (hierarchy):
Quote:
main timeline
|------ mc
|------ mc1
|------mc2
|------mc3
see the image below.
The main timeline has three buttons. Each should open one mc which would open mc1, mc2, mc3 whichever button is clicked.
How can this be done?
I tried to add loadMovie("flash/flame.swf", ifr); but it didn't work. It opens the flames.swf but not the level 2 movie clip (level 2 right? ...since level 0 is the main timeline)
Code:
var flashArray = new Array("flash/hockey.swf","flash/baseball.swf","flash/armenair.swf");
for(var i=0;i<=flashArray.length-1;i++){
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
loadMovie("flash/flame.swf", ifr);
loadMovie(flashArray[this._name.slice(3,4)], ifr.content);
}
}
Nested Movie Clips And Timeline Control Question
Hey people...
I was wondering if it was possible to control the timeline of a movie clip from a different movie clip nested inside it? Here's what's happening now. I have movie clip A... and within in... there's movie clip B. Movie clip A plays till frame whatever and stops. The user presses a button which plays clip A one frame forward where clip B begins. When clip B finishes and fades out, I'd like to have clip A go back one frame. Is this possible somehow?
Any help would be greatly appreciated! THX!
Edited: 10/09/2008 at 12:01:48 PM by Booya_boyo
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.
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.
How To Open Three Movie Clips In A Clip In A Timeline By Button?
I want this structure (hierarchy):
Quote:
main timeline
|------ mc
|------ mc1
|------mc2
|------mc3
see the image below.
The main timeline has three buttons. Each should open one mc which would open mc1, mc2, mc3 whichever button is clicked.
How can this be done?
Movie Playhead - Timeline Has Stops & Nested Clips
I’m trying to create a play-head (not a load bar) with Action Script that shows where my movie is at in its timeline…
A little something like this…
|-------------------------------------------------------------|
/
The difficulty is that on my main timeline I have 3 places where the main timeline stops to play a nested movie clip… once the nested clips finish it carries on down the main timeline again.
How can I create this play-head so it moves smoothly while still accounting for the nested clips ?… Can’t seem to wrap my head around it!
Thanks
b
How To Open Three Movie Clips In A Clip In A Timeline By Button?
I want this structure (hierarchy):
Quote:
main timeline
|------ mc
|------ mc1
|------mc2
|------mc3
see the image below.
The main timeline has three buttons. Each should open one mc which would open mc1, mc2, mc3 whichever button is clicked.
How can this be done?
I tried to add loadMovie("flash/flame.swf", ifr); but it didn't work. It opens the flames.swf but not the level 2 movie clip (level 2 right? ...since level 0 is the main timeline)
Code:
var flashArray = new Array("flash/hockey.swf","flash/baseball.swf","flash/armenair.swf");
for(var i=0;i<=flashArray.length-1;i++){
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
loadMovie("flash/flame.swf", ifr);
loadMovie(flashArray[this._name.slice(3,4)], ifr.content);
}
}
Help With Loading/triggering External Clips Into Main Movie Timeline
I have a scenario I need some input on if anyone could be so kind...hopefully it makes sense...
I have a Flash movie file, and I have 5 large 'external' SWF files being called. There are 5 buttons in the main movie, each one when clicked needs to load it's proper exteranl MC into the main movie (ie button 1 loads/plays MC1.swf)
...but, it needs to start each each external clip at Frame 2, so it can't just load the movie on frame 1 and go...
so far I have something like this, but obviously its not right:
on (release) {
_root.contents.loadMovie(“externalfile.swf”);
}
How do I code the buttons to do that properly?
Also, is there a way to preload those external clips right off the bat?
Thanks for any help...
seanpc
[MX] Attached Movie Clips Being Removed When Parent Timeline Loops
I have a movie clip with the following code:
Code:
onClipEvent(load) {
stop(); onMe = false;
if(SearchArray(EnemiesSeen, "X") == null) { tileLit = false; } else {
tileLit = true;
attachMovie("Info X", "X", 1);
}
}
onClipEvent(enterFrame) {
if(tileLit) {
if(hitTest(_root._xmouse, _root._ymouse, false)) {
onMe = true;
if(_currentframe != 21) { play(); } else { stop(); }
if(_currentframe == 41) { gotoAndPlay(1); }
} else {
onMe = false; play();
if(_currentframe == 41) { gotoAndStop(1); }
if(_currentframe == 1) { stop(); }
}
} else {
gotoAndStop(42);
}
}
onClipEvent(mouseDown) {
if(onMe && tileLit) {
// do stuff
}
}
This movie clip is a button-like tile that gives information when appropriately "lit" (when that information is applicable.) The tile's timeline is 42 frames long, with the frames 1-21 as "on roll in" animation and 22-41 as "on roll out" animation, and the last frame (42) as a dimmed out version used when the tile is inactive - all of this works fine.
The problem is that when the "tileLit" condition is true, the movie clip attaches another movie clip which seems to be removed if the parent movie clip reaches the end of it's timeline. The parent clip loops, as normal, but the child clip (which provides the actual information) is lost (I've done trace checks to ensure that it's not simply being hidden somewhere). Is this normal behavior for a movie clip, or is there some problem that I just can't seem to root out?
Thanks in advance for your time.
[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 I Recerence Movie Clips On The Main Timeline From Inside A Class?
Hey everyone, this might be a stupid question but I thought I'd ask cause it's making me nuts. I'm all of 2 days into AS3 (coming from not using Flash at all in YEARS) so feel free to consider me ignorant. I do have plenty of application development experience in other areas though.
I can't seem to create a class that can reference an instance of a movie clip on my main timeline. I'd post code of what I've tried but I've gone through so many desperate edits & wild guesses that it was just garbled junk before I deleted it all.
Basically here's how I figured Flash could work, though maybe it doesn't work this way at all.
I'm assuming that with AS 3 being so big on being a true object oriented environment, I wouldn't need to mix my code and interface together. Preferably I'd be using the Flash authoring tools just to design my interface. Create a button... place it somewhere... give it an instance name. Roughly the equivilant of Apple's InterfaceBuilder for those of you that might be familiar with Cocoa development. I can see maybe having to put a few lines of ActionScript onto frame 1 (though really I'm hoping Flash would have a better method of kicking off the application at this point that using code tied to frames) to load my classes & such, but after that I'd like all of my code to be held in external class files.
So maybe I've got:
Interface.fla - My interface
--- Button_1
--- Button_2
--- TextField_1
Main.as - My main controller class using to handle all of my applications behavior
SomeClass.as - Some helper Class
SomeOtherClass.as - Some helper Class
Main.as would have instructions in its initialization method to go ahead & attach events to buttons & initialize anything else that needs to happen when the application starts. From there on it would all be objects communicating back & forth. Button_1 would get clicked with would fire Main.someMethod(). Main.someMethod() would then do it's thing and set the value of TextField_1. All very clean & code is very separated from interface.
Unfortunately I can't for the life of me figure out how AS3 classes reference each other like that. There doesn't seem to be any kind of a global 'root' or '_root' I can use to locate any movie clips on the stage. I've searched the help & the web for any kind of simple tutorial but to no avail. My job has tasked me with building a flash app for a project but I'd really rather not have a tone of ActionScript just shoved into frame 1. That just seems... ugh! (::shudder::)
Can someone maybe point me in the right direction here? I'm really willing to do my homework but I can't seem to locate the info I need to get started. Also, is there an ActionScript IRC channel or something maybe?
Thanks,
Cliff
Help With Loading/triggering External Clips Into Main Movie Timeline
I have a scenario I need some input on if anyone could be so kind...hopefully it makes sense...
I have a Flash movie file, and I have 5 large 'external' SWF files being called. There are 5 buttons in the main movie, each one when clicked needs to load it's proper exteranl MC into the main movie (ie button 1 loads/plays MC1.swf)
...but, it needs to start each each external clip at Frame 2, so it can't just load the movie on frame 1 and go...
so far I have something like this, but obviously its not right..it's only calling and loading the external clip, but not goign to frame 2 like I want it:
on (release) {
_root.contents.loadMovie(“externalfile.swf”);
}
How do I code the buttons to do that properly?
Also, is there a way to preload those external clips right off the bat?
Thanks for any help...
Van
Using Loaded External Text To Control Movie Clips/timeline?
Hi everyone! I've been away from Flash for a while and I've gotten pretty rusty (not to suggest I was very good before, but...
I use an externally loaded text file that loads into a movie for simplicity's sake for my client. I know how to make regular links that point to other websites using <a href=" ">, but I don't know how to point to a particular place in the timeline of my movie. For example, this external text file loads into Frame 10. By clicking a link from the text file, I want the movie to go to Frame 5 on the same timeline. I need to be able to have multiple links that point to various points on the timeline.
I tried searching and found some people suggesting "asfunction," but it wasn't helping me (or it went right over my head! ).
I hope my question makes sense -- I appreciate any input!
How Do I Reference Movie Clips On The Main Timeline From Inside A Class?
Hey everyone, this might be a stupid question but I thought I'd ask cause it's making me nuts. I'm all of 2 days into AS3 (coming from not using Flash at all in YEARS) so feel free to consider me ignorant. I do have plenty of application development experience in other areas though.
I can't seem to create a class that can reference an instance of a movie clip on my main timeline. I'd post code of what I've tried but I've gone through so many desperate edits & wild guesses that it was just garbled junk before I deleted it all.
Basically here's how I figured Flash could work, though maybe it doesn't work this way at all.
I'm assuming that with AS 3 being so big on being a true object oriented environment, I wouldn't need to mix my code and interface together. Preferably I'd be using the Flash authoring tools just to design my interface. Create a button... place it somewhere... give it an instance name. Roughly the equivilant of Apple's InterfaceBuilder for those of you that might be familiar with Cocoa development. I can see maybe having to put a few lines of ActionScript onto frame 1 (though really I'm hoping Flash would have a better method of kicking off the application at this point that using code tied to frames) to load my classes & such, but after that I'd like all of my code to be held in external class files.
So maybe I've got:
Interface.fla - My interface
--- Button_1
--- Button_2
--- TextField_1
Main.as - My main controller class using to handle all of my applications behavior
SomeClass.as - Some helper Class
SomeOtherClass.as - Some helper Class
Main.as would have instructions in its initialization method to go ahead & attach events to buttons & initialize anything else that needs to happen when the application starts. From there on it would all be objects communicating back & forth. Button_1 would get clicked with would fire Main.someMethod(). Main.someMethod() would then do it's thing and set the value of TextField_1. All very clean & code is very separated from interface.
Unfortunately I can't for the life of me figure out how AS3 classes reference each other like that. There doesn't seem to be any kind of a global 'root' or '_root' I can use to locate any movie clips on the stage. I've searched the help & the web for any kind of simple tutorial but to no avail. My job has tasked me with building a flash app for a project but I'd really rather not have a tone of ActionScript just shoved into frame 1. That just seems... ugh! (::shudder:
Can someone maybe point me in the right direction here? I'm really willing to do my homework but I can't seem to locate the info I need to get started. Also, is there an ActionScript IRC channel or something maybe?
Thanks,
Cliff
Help With Loading/triggering External Clips Into Main Movie Timeline
I have a scenario I need some input on if anyone could be so kind...hopefully it makes sense...
I have a Flash movie file, and I have 5 large 'external' SWF files being called. There are 5 buttons in the main movie, each one when clicked needs to load it's proper exteranl MC into the main movie (ie button 1 loads/plays MC1.swf)
...but, it needs to start each each external clip at Frame 2, so it can't just load the movie on frame 1 and go...
so far I have something like this, but obviously its not right..it's only calling and loading the external clip, but not goign to frame 2 like I want it:
on (release) {
_root.contents.loadMovie(“externalfile.swf”);
}
How do I code the buttons to do that properly?
Also, is there a way to preload those external clips right off the bat?
Thanks for any help...
Van
[AS]assigning Event Handlers To Movie Clips From Main Timeline
Hi
Can anyone tell me why this doesn't work.
(here's a very simple example)
You make a movie clip which is just, for example, a graphic square, nothing to it, one frame.
You put the movie clip 'on stage' frame 1 of the main time line, and give it an instance name of 'bob' in the properties dialogue box.
You ensure (by right mouse clicking in the library) that the movie clip linkage property has 'export for actionscript' and 'export in first frame' checked.
now you go click back onto your ROOT timeline
in your *ROOT* timeline you create a script on frame 1 which reads
bob.onRelease = doClick;
function doClick() {
trace("hello");
}
I would have thought that script would make it so if I clicked the movieclip bob I get the 'hello' message..?? but it doesn't seem to work....
ALTERNATIVELY:
If I put the line inside the movieclip timeline:
this.onRelease = this._parent.doClick;
then it works, BUT, I am trying to assign the event handler from the ROOT timeline, and I can't see why it shouldn't be possible..??
any help very gratefully recieved!
Thankyou
James
|