[MX04]Movie That Works Fine When Clips Apart Acts Strange When Clips Are Together.
Hi,
I have a pretty basic movie in which a ball moves along a track.
The track is made up of 3 sections & all I want the movie to do is trace an ID number (num) that is an individual property of that clip when it goes over it.
In the first movie attached below “trackOne” the whole thing works great! However in the other movie “trackTwo” I have moved the clips closer together & the whole thing has gone crazy with the following issues.
1.)The “trace” command fires on every “onEnterClip” event
2.)A text field that is used to show the ID number only changes when the ball is fully over the clip not as it first touches it, as it does in the first movie
3.)Although the ball is full off a clip it keeps tracing it’s ID number together with the new clips number?
Anybody able to help me on this?
FlashKit > Flash Help > Flash Newbies
Posted on: 04-13-2008, 04:45 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Strange Behavior - Creating, Loading Movie Clips Works Only For First Function Call
Hello,
I am reading an XML document and creating empty movie clips and attaching multiple instances of a movie clip from the library into each empty movie clip.
it works fine in the first loop and function call but after that, the movie clips register as being created, and attached but they aren't showing up.
Here's some of the code, in a nutshell:
[code]
function call_xml( start_cnt )
{
var xml_menu:String = 'gallery.xml';
menuXML = new XML();
menuXML.ignoreWhite=true;
menuXML.load( xml_menu );
menuXML.onLoad = parse_xml;
}
function parse_xml()
{
//---- create holder movie clips w/in the pc_movie_loader
//---------------------------------------------------------------------------
_root.pc_movie_loader.mc_holder_clip.unloadMovie();
_root.pc_movie_loader.createEmptyMovieClip( 'mc_holder_clip', 1 );
//----------------------------------------------------------------------------
for( var i:Number = 0; i < node_1.length; i++ )
{
subnode_1 = node_1.childNodes;
if( i >= this_start_cnt && i < this_end_cnt )
{
_root.pc_movie_loader.mc_holder_clip.createEmptyMovieClip( 'mc_demo_panel_' + i, i );
_root.attach_movie_clip('reg_demo_panel', _root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i], '', row_x, row_y );
_root.print_clip_elements(_root.pc_movie_loader.mc_holder_clip);
row_cnt++;
row_y = row_y + (_root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i]._height + 10);
if( row_cnt == 2)
{
row_x = 444;
row_y = 10;
row_cnt = 0;
}
}
}
}
and here's the print_clip_elements test function I'm using to print the contents of the movie clips:
function print_clip_elements( clip:Object )
{
for( var j in clip )
{
trace( "****** j:" + j + " : " + clip[j] );
}
}
and here's the attach_movie_clip test function I'm using to attach the movie clips from the library:
function attach_movie_clip( movie_clip:Object, level:Object, message_var:String, x_coords:Number, y_coords:Number )
{
level.attachMovie( movie_clip, movie_clip,10,{_x:x_coords,_y:y_coords});
}
[/code]
When I call the print clip elements the output is as follows for every function call:
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_7 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_7
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_panel_4
===== END PRINT MOVIE CLIPS ============================
it's registering that all the movie clips have been created and the mc_demo_panel library item has been attached.
Any ideas why the first function call works and everyone after that doesn't?
Thanks,
Clem C
Strange Behavior - Creating, Loading Movie Clips Works Only For First Function Call
Hello,
I am reading an XML document and creating empty movie clips and attaching multiple instances of a movie clip from the library into each empty movie clip.
it works fine in the first loop and function call but after that, the movie clips register as being created, and attached but they aren't showing up.
Here's some of the code, in a nutshell:
Code:
function call_xml( start_cnt )
{
var xml_menu:String = 'gallery.xml';
menuXML = new XML();
menuXML.ignoreWhite=true;
menuXML.load( xml_menu );
menuXML.onLoad = parse_xml;
}
function parse_xml()
{
//---- create holder movie clips w/in the pc_movie_loader
//---------------------------------------------------------------------------
_root.pc_movie_loader.mc_holder_clip.unloadMovie();
_root.pc_movie_loader.createEmptyMovieClip( 'mc_holder_clip', 1 );
//----------------------------------------------------------------------------
for( var i:Number = 0; i < node_1.length; i++ )
{
subnode_1 = node_1[i].childNodes;
if( i >= this_start_cnt && i < this_end_cnt )
{
_root.pc_movie_loader.mc_holder_clip.createEmptyMovieClip( 'mc_demo_panel_' + i, i );
_root.attach_movie_clip('reg_demo_panel', _root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i], '', row_x, row_y );
_root.print_clip_elements(_root.pc_movie_loader.mc_holder_clip);
row_cnt++;
row_y = row_y + (_root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i]._height + 10);
if( row_cnt == 2)
{
row_x = 444;
row_y = 10;
row_cnt = 0;
}
}
}
}
and here's the print_clip_elements test function I'm using to print the contents of the movie clips:
function print_clip_elements( clip:Object )
{
for( var j in clip )
{
trace( "****** j:" + j + " : " + clip[j] );
}
}
and here's the attach_movie_clip test function I'm using to attach the movie clips from the library:
function attach_movie_clip( movie_clip:Object, level:Object, message_var:String, x_coords:Number, y_coords:Number )
{
level.attachMovie( movie_clip, movie_clip,10,{_x:x_coords,_y:y_coords});
}
When I call the print clip elements the output is as follows for every function call:
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================
===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_7 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_7
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================
it's registering that all the movie clips have been created and the mc_demo_panel library item has been attached.
Any ideas why the first function call works and everyone after that doesn't?
Thanks,
Clem C
[MX04] SWF Works Fine Until Dynamically Loaded?
Hello
I have created a quiz page that works fine when viewed in its own .swf but it appears to have problems when I dynamically load it into a separate swf as a movie clip. The particular Action scripting I am having a problem with is this:
on (release) {gotoAndPlay(36);
_root.NewQuiz.B.gotoAndStop(36);
_root.NewQuiz.D.gotoAndStop(36);
_root.NewQuiz.C.gotoAndStop(36);
_root.NewQuiz.B.incorrectB._visible = false;
_root.NewQuiz.D.incorrectD._visible = false;
_root.NewQuiz.C.incorrectC._visible = false;
}
The black text works fine in both the regular swf and once it is dynamically loaded but the red text seems to be completely ignored.
I think the problem have something to do that the quiz lies within a movieclip within the .swf and it is somehow conflicting with the how the page is dynamically pulled into the other page, but I am clueless as to why.
Can anyone help?
Strange Tremblin Of Movie Clips
Hi,
I have a main movie loading 10 small movies, and making them move around the main stage in a random way. I dont understand why some of them move shaking, like trembling. I cant figure out what is the problem cause each time I generate the main movie different clips shake, its not always the same that have this strange behavior. anybody knows why this happens? Im not sure If I can upload all the files (too heavy) but if its necesary to help me solve it Ill find a way to upload them.
Thanks in advance
External Movie Clips, Strange Problem
Using external movie clips is cousing some strange problems.
if I use this code, btn1 opens oneA from inside one_mc
Code:
on (release) {
_level0.main_mc.one_mc.gotoAndPlay ("oneA");
}
but if I use the same code on btn2 it will not open twoA from inside two_mc
Code:
on (release) {
_level0.main_mc.two_mc.gotoAndPlay ("twoA");
}
Why?
Something VERY.. But Very Strange About Movie Clips Coordinates Whilst In HTML
Hi ppl,
Maybe one of you came across this issue coz its been drivnig me nuts. I wrote a ticker script which moved 2 text fields one next to the other and when one of them was outside the stage he was positioned on the other side of the text field that was visible.
The logic worked just fine in Flash but not when the movie was embedded in HTML. After some debugging and tracing I've notinced that whilst a movie clip's initial x pos in Flash was 10 for exampel, the same movie clip's x pos was -60 when the movie was embedded in HTML.
I thought it might have something to do with global/local issues but the text fields are positioned on the root and the it works just fine in Flash but for some strange reason the numbers change when in HTML.
Does anyone have any idea how and why something like this would happen??
Cheers,
McMurphy
[MX04] Communication Between Two Movie Clips
I am stumped on this one, so maybe someone wiser to the ways of Flash MX04Pro might help. I'm not sure how to illustrate this problem very well so please let me know if the following is completely confusing.
I currently have a file with the following basic structure:
MAIN TIMELINE {frames: a {containing MC X with local timeline including frames: I, II, III... } , b, c {containing MC Y with local timeline including frames I, II, III ... } d ...}.
What I am trying to do is have a button in (MAIN TIMELINE/frame a/MC X/ frame II) cause the playhead to move to (MAIN TIMELINE/frame c/MC Y/ frame III). Whew.
I first attempted to place this code in the button (with the actual instance names, of course, and not these):
Code:
on (release) {
_root.gotoAndPlay("c");
_root.MC Y.gotoAndPlay("III");
}
I was hoping that this would cause the main playhead to move to the desired frame in the main timeline and then cause the MC's playhead to move it's desired frame in it's timeline. No luck.
My next thought was to create a function that sent a variable to the MC that would tell it which of it's frames to play. However, I am shaky on how to do this. Can anyone lend a hand?
Thanks, and let me know if I need to explain this more thoroughly or post more detailed code.
-ZR
[MX04] Movie Clips - Closing Them
Hi there
I have a movie clip (a) and another movie clip (b) inside it which plays when a button is pressed in movie clip (a). How do i get back to first frame of movie clip (a)?
I have a button called 'close' in movie (b) which i'm trying to code so that movie (b) closes and it goes back to the original movie (a).
I'm not doing things right i know and need some help.
Cheers
M
[MX04] Help With Duplicating Movie Clips?
I just went through all of the tutorials in the games sections, and could not find ANYTHING on duplicating movie clips after Flash 4, not even in game things. The only ones I did find were in Flash 4.
So I attacked the idea of duplicating movie clips myself.
I created one frame, with a bullet (A grey paint streak, just imagined it as a... really slow bullet), made it a movie clip, and added the code:
onClipEvent(enterFrame) {
this._x+=5
}
I gave the frame (There is only one frame) this code:
stop();
if(key.isDown(key.SPACE)) {
duplicateMovieClip(bullet, bullet1, 100)
}
This is the listing on the help:
duplicateMovieClip(name,newname,depth)
I have no idea what the depth is for, so I just set it to 100 assuming it was the same as alpha or opacity.
And guess what happened:
The bullet moved like it was supposed to, but nothing happened at all when I pressed space.
All I want to do is have pressing the space bar create a duplicate of that movie clip from it's original position.
Can anyone help me fix this?
ATTENTION: Please do not offer me a free toaster.
[MX04] Backwards Movie Clips
This is what i got so far,
A really freaky man-chick thing flashes on the screen, then it cuts to a clip of 4 guys running down a flight of stairs, then when they get to the bottom of the satires the chick-man thing flashes again, and then what i want to happen is have them run up the steps in reverse. How do i get the movie clip to play in reverse? i used to know,but cant remember how to do it.
Any help would be much appreciated.
[MX04] Removing Movie Clips
I am making a platformer game that calls certain sectors of the level, and loads them when the current sector is off the screen. But when i do this, I use this code to unload the clip when it runs off of the screen. It doesn't do it though.
Code:
function sectorSwap(){
sectorCoords = platform["sector" + (sectorFocus - 1)].getBounds(_root)
if(sectorCoords.xMax <= 0){
platform["sector" + (sectorFocus - 1)].unloadMovie();
}
sectorCoords2 = platform["sector" + sectorFocus].getBounds(_root)
if(sectorCoords2.xMax <= 800){
sectorFocus = sectorFocus + 1;
attachNextSector();
}
}
Will it not unload because I put the movie in with AttachMovie?
[MX04] Buttons And Movie Clips...
Hi Everyone,
I am currently working on a project that I am having trouble with. I've got a navbar and some text. What I am trying to do is when you select "home" the text fades in, then stays there until you select (for example) "about us" which would then fade out the text that was currently there, and then fade in new text. These navbar buttons also have to change the page. What I have done is created a movie clip which has the fading in and out effects for each set of text. All of the appropriate keyframes have the stop action, and all of the appropriate frame labels (or are they called instances, I can't remember). This is where my problem starts. I can get it so it plays the text fading in, and then fading out when another button is selected, but I can't get it to fade the new text in. If there was a way to "pause" the action script I could make it work, but I think I'm out of luck there. The type of action script I'm using is the "on release" and _root.header and gotoandplay ().
Anyways I think that's all, but I'm sure I have missed something important. I can set the .fla online and give you the link if need be.
Thank you for your time, I appreciate it.
~FOX~
Creating, Loading Movie Clips Works Only For First
Hello,
I am reading an XML document and creating empty movie clips and attaching multiple instances of a movie clip from the library into each empty movie clip.
it works fine in the first loop and function call but after that, the movie clips register as being created, and attached but they aren't showing up.
Here's some of the code, in a nutshell:
CODEfunction call_xml( start_cnt )
{
var xml_menu:String = 'gallery.xml';
menuXML = new XML();
menuXML.ignoreWhite=true;
menuXML.load( xml_menu );
menuXML.onLoad = parse_xml;
}
function parse_xml()
{
//---- create holder movie clips w/in the pc_movie_loader
//---------------------------------------------------------------------------
_root.pc_movie_loader.mc_holder_clip.unloadMovie();
_root.pc_movie_loader.createEmptyMovieClip( 'mc_holder_clip', 1 );
//----------------------------------------------------------------------------
for( var i:Number = 0; i < node_1.length; i++ )
{
subnode_1 = node_1[i].childNodes;
if( i >= this_start_cnt && i < this_end_cnt )
{
_root.pc_movie_loader.mc_holder_clip.createEmptyMovieClip( 'mc_demo_panel_' + i, i );
_root.attach_movie_clip('reg_demo_panel', _root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i], '', row_x, row_y );
_root.print_clip_elements(_root.pc_movie_loader.mc_holder_clip);
row_cnt++;
row_y = row_y + (_root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i]._height + 10);
if( row_cnt == 2)
{
row_x = 444;
row_y = 10;
row_cnt = 0;
}
}
}
}
and here's the print_clip_elements test function I'm using to print the contents of the movie clips:
function print_clip_elements( clip:Object )
{
for( var j in clip )
{
trace( "****** j:" + j + " : " + clip[j] );
}
}
and here's the attach_movie_clip test function I'm using to attach the movie clips from the library:
function attach_movie_clip( movie_clip:Object, level:Object, message_var:String, x_coords:Number, y_coords:Number )
{
level.attachMovie( movie_clip, movie_clip,10,{_x:x_coords,_y:y_coords});
}
[MX04] Buttons Triggering Other Movie Clips
Im using MX 2004 and i was wondering how i could do this:
when you roll over a button it triggers a movie clip to run. The longer you hold your mouse over the button, the longer the MC runs. when you take your mouse off the button the MC stops on that frame.
any advice on how to create this would be great.
thanks
[MX04] Duplicate Multiple Movie Clips
I want multiple instances of the f(x) logo on the screen at the same time. What do you suggest?
http://funkshun.us/banner.xhtml
the f(x) logo is name fxfade_mc and there is one instance placed off the stage
// root frame 1
Code:
function fxfade(){
moviename = random(10);
varrotate = random(360);
varscale = random(120)+50;
xlocation = random(530)+30;
ylocation = random(115)-30;
duplicateMovieClip(fxfade_mc, moviename, 0)
};
setInterval(fxfade, 500);
// inside the fxfade_mc movie on frame 1
Code:
this._xscale = _root.varscale;
this._yscale = _root.varscale;
this._x = _root.xlocation;
this._y = _root.ylocation;
this._rotation = _root.varrotate;
// inside the fxfade_mc movie on last frame
Code:
varname = this.name
if(varname != "fxfade_mc"){
this.removeMovieClip();
}
stop();
[MX04] Preloader, Then Load Movie Clips Help
I am having trouble with the actionscript here. Preloader works fine, then goes to movieclip1 (slide1) which then plays.
But then I want it to play movieclip2, which is an external mc, and then from movieclip2 (slide2) I want it to cycle back to movieclip1 and play.
Can anyone help me with this?
I'm attaching the (not completed and inserted smaller jpegs for the purpose of uploading) file here...
BIG NOTE: There's a third actionscript file you need but it won't let me upload it.
Take the code below and create a file called Preloader.as, save it to the root.
class Preloader extends MovieClip{
private var target_mc:MovieClip;
private var progress_mc:MovieClip;
private var pct_str:String;
private var dispatchEvent:Function;
public var addEventListener:Function;
public var removeEventListener:Function;
function Preloader(){
// initialize with EventDispatcher so the preloader can broadcast events
mx.events.EventDispatcher.initialize(this);
}
public function startPreload(t:MovieClip){
// set a reference to the timeline that is loading
target_mc = t;
// reveal the preloader clip
this.gotoAndPlay("IN");
}
private function onAnimateIn(){
this.stop();
// this is called from the preloader mc timeline on the last frame of the 'in' animation
// starts checking the load progress of the target movie clip on each frame
this.onEnterFrame = this.checkLoadProgress;
}
private function checkLoadProgress(){
// get the total bytes and the loaded bytes of the target clip
var bl = target_mc.getBytesLoaded();
var bt = target_mc.getBytesTotal();
// calculate the percentage of bytes loaded
var pct = bl/bt;
// get the current frame and total frames of the progress clip
var cf = progress_mc._currentframe;
var tf = progress_mc._totalframes;
// calculate the frame that corresponds with the load percentage
var f = Math.ceil(tf * pct);
// if the current frame of the progress mc is less than the value of f then let the clip play
// otherwise, stop the progress clip to wait for f to catch up with the current frame
// this prevents the animation from jumping ahead if the target clip is loading faster than
// your progress animation
if(f > cf){
progress_mc.play();
}else{
progress_mc.stop();
}
// set percent display in preloader_mc based on percentage of frames that have played
this.pct_str = (Math.round(cf/tf * 100)).toString();
// if the clip is entirely loaded, and the progress clip has played all the way through
// then the preloading is complete
if(bt > 20 && bl == bt && cf == tf && progress_mc){
onPreloadComplete();
}
}
private function onPreloadComplete(){
// stop the check load call
this.onEnterFrame = null;
// animate the preloader
this.gotoAndPlay("OUT");
}
private function onAnimateOut(){
this.stop();
// dispatch event that tells any listeners that the preloader is done
dispatchEvent({target:this, type:'onPreloaderOut'});
}
}
[MX04] Looping Multiple Movie Clips
Hello all-
I am creating an ad/header graphic for a web site. I have 7 movie clips that I need to rotate through. They are pretty basic movie clips, picture fades in, text fades in, pauses for 15 seconds, then needs to move on to next movie clip. There's where my problem lies.
I have it set up on Scene 1, where I have movie clip 1 as a layer 1, movie clip 2 as layer 2, movie clip 3 as layer 3, etc. When I preview it, only movie clip 1 plays and then it repeats itself. It never makes it to the next movie clip. Is there some action script that I can put in to make it jump to the next movie clip? Is there an easier way to do this, or do I need to create one long movie clip that includes all 7 movies?
Thanks!
Kauzmo
[MX04] Loading Multiple Movie Clips
I have a movie that I am trying to load two other movies into. One is a nav and the other a looped movie sequence.
I created two empty movie clips in the main movie clip:
mcLoader and mcLoader2
on an actions layer I have:
mcLoader.loadMovie("MovieClips/nav2.swf");
mcLoader2.loadMovie("MovieClips/ex1.swf");
Neither file loads or the first loads if I remove the second. The movies are in teh right folders. I'd appreciate some hints. I'm sure I'm missing something but I've been looking at this forever. Thanks in advance for any advice, I appreciate it
[MX04] The Same Random Frame In Two Different Movie Clips
Hi, I'm a student at university and I frequently work with flash MX 2004. I'm currently working on a project that involves many characters on screen at once. only as a twist, I wish to have them scripted so that they all look different every time the swf is played.
for example, I have the head working. when the character is loaded into the frame, a random face, hairstyle and hair colour is chosen and works every time.
however what I'm stuck on is the rest of the body. I can easily set every body part at random but that will result in a bunch of characters wearing multicoloured clothing. each body part of the character is a seperate movieclip embedded into one movieclip.
right now, so that I can get a feel of it, I'm working on the shoes. I want the style of shoe to be random but i want both shoes to come out the same. initially my idea was that I have the random script on one shoe and then use script on the right but all my ideas fall short. here is what I have so far:
on the left shoe:
onClipEvent (load)
{
gotoAndStop(random (6));
}
and then on the right shoe:
onClipEvent(load)
{
gotoAndStop ((zombie.foot1.shoe1.currentFrame));
}
that was my first idea, I also thought about having:
this.currentFrame == zombie.foot1.shoe1.currentFrame;
and also the same only with currentFrame replaced with frameNumber.
this is the best that I can explain it. if people need me to go into more detail I'll be happy to.
any help would be great as I'd really love to get these things working
[MX04] Load / Unload Movie Clips
I am loading external SWFs on my main flash file.
For every External SWFs:
They also have multiple levels. There is a base SWF and then 5 levels of other external SWFs there.
So- i load an external SWF on my main flash and that external SWF also has its own external SWFs.
This is how i do that:
on my main flash file.. i create a blank MC:
this.createEmptyMovieClip("blank1", this.getNextHighestDepth());
Now, by default i load my first external MC there (ExtMC1)
_root.blank1.loadMovie("ExtMC1.swf");
Now i have a button (Button2) and when it should be clicked- it should replace ExtMC1 with ExtMC2.
_root.blank1.loadMovie("ExtMC2.swf");
This just don't work because it does replace the base file for ExtMC1 but the external SWFs within ExtMC1 remains on the main flash file..
so i use this instead:
button2.onRelease = function() {
unloadMovieNum(1);
unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
_root.blank1.loadMovie("ExtMC2.swf");
};
so basically i clear all the levels first and then load my second MC (ExtMC2.swf).
similarly to load my third MC i use this on button 3:
button3.onRelease = function() {
unloadMovieNum(1);
unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
_root.blank1.loadMovie("ExtMC3.swf");
};
is there any better way of doing the same- it does work but the issue is, when the first MC (ExtMC1) is loading and click on the button 2 to load the second MC (ExtMC2) - it takes a lot of time.. so i need an effective way of doing the same.. please help.
How To Code For The Button So The Movie Clips Underneath It Works?
hi,i am making this animated button from a tutorial(the tutorial only finish teaching making the buttons).
i had made this mcBtnHome,mcBtnLinks,mcBtnProducts,mcBtnPress. all these mc they have a empty button and the code is :
on (rollOver) {
with (_root.button06.arrow) {
gotoAndPlay(2);
}
gotoAndPlay("in");
}
on (rollOut) {
with (_root.button06.arrow) {
gotoAndStop(1);
}
gotoAndPlay("out");
}
this code makes the mcBtnHome,mcBtnLinks,mcBtnProducts,mcBtnPress animated when users mouseover them.
here comes the problems:
when i put all these mcBtnHome,mcBtnLinks,mcBtnProducts,mcBtnPress on the stage and then i put one more empty button on top of it cos i want when user on release go to play timeline 10 which is on the stage and so on.
so the problem is now when user mouse over the mcBtnHome,mcBtnLinks,mcBtnProducts,mcBtnPress
the animated doest work properly anymore.
what should i do?
could anyone who knows these help me out ?i really appreciate it ^^v
i had attached the file too.(and the products button is not function properly cos i put one more empty button on top of it)
thanks a thousand!!!!!!!!! ^^v
[MX04] Changing Attributes Of Movie Clips In Other Frames
Hi there,
I have a problem in changing an attribute of a movie clip (in frame 1) using an on(release) command from a button in another frame(frame 2).
I have adapted an example in the attachment for this post. Notice the code on frame 2 button doesnt work.
Any help appreciated.
Thank You
Scrolling Multiple Movie Clips Simultaneously [MX04]
hello all...
i have a fairly complex question:
i'm building a gallery. there will be one main page with thumbnails, each representing a sub-gallery. what i've done is construct 11 separate _mc's so that onRollover, the thumbnail fades in from 40% to 100% _alpha and a line of text appears underneath the thumbnail. then, onRelease, each thumbnail acts as a button to gotoAndPlay another frame on the main timeline. each sub-gallery will occupy one frame on the main timeline and jpegs will be loaded from an external XML file. this part works fine.
now, what i'd like to do is somehow "group" the 11 _mc's on the main gallery page so that i can have them scroll from left to right simultaneously onRollover, possibly using a mask or invisible button. they are each 150px wide, so they don't all fit on the stage and there will eventually be MORE _mc's, each representing new sub-galleries.
what is the best way to do this?
i've done a lot of searching for tutorials on horizontal scrolling for jpgs and galleries, but i haven't been able to find something similar for _mc's. is there a way to do this dynamically (e.g. load the _mc's into another _mc?) i started reading a bit on nesting using the attachmovie() function, but it seems like that only loads one _mc per level, using the main registration point. i want all the _mc's side by side, spaced evenly, so they scroll in unison. also, i'm not sure if having two onRollover events will cause a conflict.
any help or suggestions would be GREATLY appreciated...
THANK YOU!!!
[MX04] Movie Clips - Drag N Drop Sensitivity
Greetings,
I'm experiencing problems with rectangular shaped move clips with the registration point set to the default 'center'.
They seem to be very sensitive when the mouse hovers over them to change shape to allow them to be dragged, suprising since they are of a such flat shape and not incredibly small.
Its best described as not very user friendly!
Is there anything I can do to improve/resolve this issue?
Anyone else experienced this?
Attached code to the movie clip to allow them to be dragged, also experiment with true/false value in startDrag params.
Code:
on(press) {
startDrag(this,true);
}
[MX04]Creating Functions For Pre-existing Movie-clips
Hello,
This is my third thread on these forums and in my previous threads I had always got some help.Well, now I have another serious problem, can you help me?
I am unable to create a function that can control movie clips. Let me explain:-
I have 10 movie clips on the stage and I have assigned them that whenever they crash to an object, they will go to a random position. Writing this code ten times for each movie clip would be very tedious, so, I thought about creating a function, but, it doesn't work. Here's the function, can you correct it?
Code:
var object:movieClip;
function position(object) {
var testnum1:Number;
testnum1 = random(290)+36;
_root.object._y = -77.6;
_root.object._x = testnum1;
}
position(nameofmovieclip)
PLEASE HELP IS REQUIRED!!!!
Thanking All,
Chinmaya
[MX04] Duplicating/Creating Instance Of Movie Clips
Greetings,
Im WIP in creating a game which has movieclips (bullet and live symbols) dotted on the stage but not in the visible runtime view.
These movieclips are then duplicated when required. The bullets have code attached to the movieclips however the lives symbols don't.
Is this common practise to have movieclips hidden offscreen and then duplicated to create an instance when required or is their a cleaner method to create an instance of a movieclip?
Hope that makes sense.
Thanks
Rob
[MX04] Problems Using Drop Target With Nest Movie Clips
Hi !
I wonder if anyone can help me solve this bit of code i'm having problems with..
I'm working on a site that will have a panel that can be dragged from the botttom of the screen. the panel includes navigation and data from an xml file. i have made this and called it info_mc.
the first time i created it, i realised that making info_mc the draggable item meant i lost my buttons in the panel, so i created another movieclip called drag_mc and place it in info_mc.
Theorising that when you pressed on drag_mc it would drag info_mc with it. after much tinkering with the script i got this to work as i wanted. ( when you drage it up it slides up and when youo release it slides back down out of view.
I now want to put a drop target so that when it is dragged over the target it will stick, at present the droptarget doesn't work. I've done this before but not with an embedded drag_mc . below is the script as it is at present. i'm sure the problem has something to do with the paths to drag_mc, info_mc and circleTarget. but have not been able to fix it.
The elements are laid out as so:
main timeline contains - circleTarget, info_mc
info_mc contains - Drag_mc, script for dragging (see below)
circletarget contains - 2xkeyframes with script stop(); in each.
you can see a mock up of the flash movie and download the FLA here:
http://www.bru-ha.com/flashdemo/drangndrop
http://www.bru-ha.com/flashdemo/drangndrop.swf
Here is the script info_mc that should do all the dragging and dropping.
code:
drag_mc.onPress=function(){
startDrag(_root.info_mc,true,_x,580,_x,0)
}
drag_mc.onRelease=drag_mc.onReleaseOutside=functio n(){
stopDrag();
if (_root.info_mc._droptarget == "../targetCircle") {
_root.info_mc.onTarget=true;
_root.targetCircle.gotoAndStop(2);
}else{
_root.info_mc.onTarget=false;
_root._parent.targetCircle.gotoAndStop(1)
}
}
//sets function on embedded drag button to drag info_mc
//the variables below will store the clips starting position
_root.info_mc.myHomeX=_root.info_mc._x;
_root.info_mc.myHomeY=_root.info_mc._y;
drag_mc.onMouseDown=function(){
//this variable tells us if the mouse is up or down
mousePressed=true;
}
drag_mc.onMouseUp=function(){
mousePressed=false;
}
drag_mc.onEnterFrame=function(){
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)
if(mousePressed==false&&_root.info_mc.onTarget==fa lse){
_root.info_mc._x-=(_root.info_mc._x-_root.info_mc.myHomeX)/5;
_root.info_mc._y-=(_root.info_mc._y-_root.info_mc.myHomeY)/5;
}
}
I hope someone out there will be able to help me, or give me some advice...
best
Andy
How To Remove All Movie Clips/array: Movie Clips Carry Over To Next Frames/ Scenes
Hi: I am creating a small game. So far so good, but only problem I have come across is when I jump to another frame or scene, previous movieclips (using an array) that are still running carry over to the next frame/scene.
See attached if you have some time- start clicking on answers in the game, and when time runs out some movie clips that are still running will remain on top of my end frame and carry over to the next scene as well.
Is there any sort of remove all movie clips or "clear all" type of actionscript?
thanks in advance!
Maintaining Event Behavior For Movie Clips Nested In Movie Clips
Is there any way to maintain a clip's event callbacks when said clip is nested in a parent clip that has its own definitions for those callbacks?
In other words, if clip B has a definition for .onPress and clip A has a definition for .onPress, is there anyway to maintain clip B's definition if it is nested in clip A?
I have tried doing it by making clips into movie clip subclasses but it doesn't work... but how do components work then?
Embedding Smart Clips In Movie Clips Causes Crashes...?
i noticed that if you use more than one of those drop-down menu smart clip in the common library, you can't see all the choices...
e.g.
drop in one instance
then another directly below it.
publish the movie
select the third or fourth choice from the second drop-down
let go so that your choice is selected
now re-select the second drop-down menu...
the other choices are hidden by the menu above it.
this is also the case if you try the procedure in reverse...
i.e. if the second instance is on a higher z-plane, the choices in the first will be hidden.
it seemed logical to drop the smart clip into a movie clip then use mc.swapDepth to set the z-index
got swapDepth working perfectly
(thanks, Mac8myPC): http://www.flashkit.com/movies/Scrip...98/index.shtml
but as soon as you put an instance of the smart clip into a movie clip, flash (5 for mac, PPC, OS 9.1, g4 466, 384MB) crashes as soon as you try to publish/export/test movie.
i tried it in a button as well... same thing
i've been trying to rebuild the menu in a normal movie clip form but it seems like more pain than it's probably worth...
any suggestions?
thanks in advance,
--cera
Movie Clips Inside Move Clips. How To Control?
I have an object in this case a foot with toes on it. the toes animate as well as the whole foot moving with the nails on it. I have instance names assigned for all the mc's problem is that the toes are buried about 3 layers down inside the foot_mc so they will move with the foot as well. When I assign a function to them the error compiler does not know where the nails are . What is the best way to fix or re-do this layout?
I am a total newbie to Flash and AS3, so any help would be great
I FIGURED IT OUT.
Accessing Clips Inside Clips Of Dynamically Generated Clips
Make sense?
So here's the code I'm working with. For loop generates clips containing clips. I need to access a specific clip (look_back) within the parent clip generated by the loop. Not sure how to do this.
Thanks // help appreciated
HTML Code:
var spacing1:Number = 10;
var lookA:Array = new Array();
function buildLooks(lookNum:Number) {
var looks:MovieClip = new MovieClip();
addChild(looks);
looks.x = 644;
looks.y = 64;
////////////////////
for (var i:Number = 0; i < 4; i++) {
var look:MovieClip = new Lookmc();
look.y = i*(look.height + spacing1);
look.name = "look"+i;
looks.addChild(look);
lookA.push(look);
lookA[i].look_title_txt.text = externalXML.look[lookNum].product[i].titles;
lookA[i].look_copy_txt.text = externalXML.look[lookNum].product[i].copy;
var url:String = externalXML.look[lookNum].product[i].image;
var urlReq:URLRequest = new URLRequest(url);
var lookImg:Loader = new Loader();
lookImg.load(urlReq);
lookA[i].addChild(lookImg);
var proLink:String = externalXML.look[lookNum].product[i].link;
var request:URLRequest = new URLRequest(proLink);
lookA[i].addEventListener(MouseEvent.MOUSE_OVER, onBtn0_Over);
lookA[i].addEventListener(MouseEvent.MOUSE_OUT, onBtn0_Out);
lookA[i].addEventListener(MouseEvent.CLICK, onBtn0_Click);
}
}
var activeBtn:MovieClip;
function onBtn0_Over(evt:MouseEvent):void {
trace(evt.target);
evt.target.look_back.alpha =0; // failed attempt
}
function onBtn0_Out(evt:MouseEvent):void {
evt.target.look_back.alpha =0; // failed attempt
}
function onBtn0_Click(evt:MouseEvent):void {
navigateToURL(request, "_self");
}
How Do I Load/stream Individual Movie Clips Within Other Movie Clips
I am using flash 5
I have a movie with a huge movie clip in it and that movie clip has lots of movie clips inside that. how do I load each one individually so when the viewer clicks on abutton it starts to laod the related movie clip.
Please help.. I'm working on borrowed time and borrowed money
Movie Clips Within Movie Clips: Text Link Problem
Hello.
I have a Movie Clip that is my main one with another Movie Clip inside of it. In the subordinate Movie Clip, I wish to have text linking frame (13) to frame (14) for instance. The problem that manifests is that while buttons is the subordinate Movie Clip link to frames within it with no complications, the text link from 13 to 14 with its respective code links to the last frame (would be 14) in the main Movie Clip.
Am I doomed to convert all text links to buttons in the subordinate Movie Clip or is there (what I am praying for) a code to work around this and keep frame links confined to the subordinate Movie Clip? I would appreciate any help that anyone can offer regarding this problem. Many Thanks.
Movie Clips Acting As Buttons Can't Load Other Movie Clips
Frame 1 has three movie clips on it, instance names are A, B, C. I have the following actionscript on frame 1 as well:
stop();
import flash.filters.GlowFilter;
ar = [A, B, C];
for(var z=0; z<ar.length; z++) {
ar[z].onRollOver = rollover;
ar[z].onRollOut = rollout;
}
function rollover() {
this.swapDepths(0);
this.filters = [new GlowFilter(0x333333, .20, 7, 7)];
}
function rollout() {
this.filters = null;
}
This code creates a glow, obviously, on whatever movie clip I rollover. What I want to do as well is this:
I want to click on mc "A" and have it launch a different movie clip (let's say "X") on top of everything else (so that A, B and C are still visible in the background). "X" is in a sub-folder of "A" if that makes any sense or is relevant. Same kind of action for mc's B and C. B should launch mc "Y" and C should launch mc "Z".
What is the actionscript for this? Any questions please let me know. Please respond, I need this info as soon as possible. Much appreciated!!
Text
External Movie Clips With Multiple Menu Movie Clips
It's pretty late and I don't think i have enough time to search this question in the forums but here I go. Sorry If I upset someone for making a topic that already exists.
I have a main timeline that im importing an external movie clip in. This external movie clip is named "members" it has several buttons that load other external movie clips into a window within "members" . What do I need to do to make this work. Do I need to use "this, _parent, _root, level(s) or "whatever.swf". If you can help me out that will be great. I'll make it up to you down the road. No sexual favor please.
I'm using flash mx 2004 btw.
Thanks in advanced
Movie Clips, Vs. Smart Clips Vs My Brain
I am having a difficult time trying to wrap my head around the MC process and its usefulness. I know they are very beneficial, make things easier, file sizes smaller etc. but I can't seem to make logic mesh with my brain cells.
Does anyone have a good way of explaining the "How to's" and "Why for's" of Movie Clip's????
Also, what is the difference between a Movie clip and a Smart clip?? (The latter I have the same questions about as well.)
Thanks,
Controlling Instances In Movie Clips From Other Clips
I am trying to get a button on my level 2 in my main movie to point to a frame inside a movie that has been loaded in on level 3 on the main movie. I have tried all different kinds of combinations and no success. I even tried putting the level 3 movie in an empty movie clip on the root, and naming the instance "music", and then writing in the button _root.music.GotoAndPlay(3); I need it to target frame 3 in my level 3 movie. Should I put the level 3 movie in its own empty movie clip? I was able to get the button to unload movie3, but I don't want it to dissapear, I just want it to go to frame 3 in the movie clip to turn off the music.. You can see what I mean at the address below. I have my audio player in the bottom right with an on/off that works fine, but when I go to the link in my site "Music" there are some downloadble MP3's, and when you click on one I want the "equalizer bars" you see in the audio in the lower right corner to stop, and it means I need it to go to frame "3" of tha movie clip for that to happen, just like it does when you click on "off" in the audio movie. Anyway, sorry this is long winded, but wanted to make sure it was clear as to what I am trying to do..
Thanks in advance,... Here is the link
http://www.incogneato.tv/stales
Mike
Movies Clips Called Within Other Movie Clips
I started this flash porject a while back and haven't touched it in a long time...a few problems to it, that I will fix one problem and then ask for the next problem.
I have a flash file called playin.fla with 2 frames, frame one has a movie clip that is a intro, frame 2 is my main screen with the nav and all the good stuff.
I have 4 buttons on that with a blank screen to load my stuff in, and it is called 'screen'
So here is my code that isn't working:
on (release) {
loadMovie("portfolio.swf", "_root.screen");
}
Easy to fix I am sure, I have tried _parent.screen as well, doesn't work....
Thank you very much for your help in advance.
Clips Within Movie Clips And Instance Troubles
I'm trying to create ultimately 9 seperate instances that function seperate from each other perhaps after being click on within their own hit box.
directions: up and down to cycle squares, click (anywhere) to rotate.
As it stands the first instance is the only one that reacts to the up and down commands and both react at the same time (bad) to the clicking for rotation...
go here http://maroonedmoon.com/cubes.swf to see the swf if action...
I need these two squares to act independent of each other, i've tried naming them different things, and even duplicating the symbol with different names... but it's not working. I imagine the issue is with my simplified actionscript...
any help is greatly appreciated
and here's my .fla
Empty Movie Clips And Duplicating Clips
I've been trying to reproduce an animation effect I've seen on the Armani website, but I'm stuck trying to duplicate an empty movie clip with image loaded into it. The duplicates exist and I can move them, but they are invisible. Since the duplicates reside on depths above the intitial clip I'm confused about why they are invisible. The duplicates are scripted to follow behind the initial clip - each offset by 30 pixels (though I don't have that working perfectly).
I'm attaching a simplified version of my file to isolate just the duplication troubles. Thanks for the help!
Movie Works Fine In Standalone SWF But Not In Html
Hi Peeps
I made a movie last night which works fine in the standalone swf player on my hdd. However when I attempt to open it from the html file which was produced by Flash MX when I published the movie It does not work and all I get when I right click on the movie is "Movie Not Loaded".
This is not the first time this has happened. Has anyone come across this before? I am using Flash MX with latest Flash Player for Internet Explorer.
Thanks.
Movie Not Loaded In MSIE (works Fine In FF...)
Stupid MS-Interweb Exporer, ruining my life =(
I have been enlisted by some friends to do the flash for thier website which is fine and i have just finshed tinkering with the menu and stuff.
www.thefieldofchampions.com/menu.htm is the object in question. Its a fiarly simple menu, it loads the contents of its links from an external XML file so that people can add/edit links without havin to fiddle with the flash source.
Loads and operates fine in FireFox however MS-IE it refuses to load. Anywhere. Local, from the server -at home, college, work etc. all I get is a nice big white area which when right clicked on returns "Movie Not Loaded" in the context menu.
What am i doing wrong, i cant think what it can be and its kinda starting to hack me of now =
Any advice on this one greatly appreciated
Thanks
AJ
Movie Won't Load In Browser...works Fine On My Comp?
Hey all, can someone pls take a look at my file and tell me why my audio console won't load when i upload my site but works fine on my pc?
I'd really appreciate some help.
Here's the file:
VMAX3.fla
the loadMovie script is in the "conbut" layer in frame 58.
GotoAndPlay Acts Strange With Second OnRelease
Hey so I redesigned my website the other day. I've made it very simple just using gotoAndPlay scripts. Although I've used them many times, this time strange things are happening.
If I click a button ie "philosophy", it jumps to frame 2 as it should. However if I click "philosophy" again, it goes to frame 3, clicking it again sends it back to frame 2 again, then back to frame 3 and so on.
I have the following type of script on the parent timeline for each set of buttons (studio_list in this case), that way I can target them all from one frame.
stop();
studio_list.philosophy.onRelease = function() {
studio_list.gotoAndPlay(2);
};
studio_list.biography.onRelease = function() {
studio_list.gotoAndPlay(3);
};
studio_list.contact.onRelease = function() {
studio_list.gotoAndPlay(4);
};
I've used this same approach everywhere and it does the same thing everywhere, no matter where the frames are etc.
Any ideas?
Cheers,
Barton
Screwy Stuff With Movie Clips Within Movie Clips
This is kind of difficult to explain but here it goes...
I have created a Barney's like slide site and have gotten it to work fine. the problem I'm having is when I take scroll text box and try to place it on the movie clip that is going to be the part of the site that is going to slide out.
The whole thing slides fine and the scroll box is visible. However, the text is not visible therefore I'm not sure if the up/down buttons are actually working.
The scroll box is a movie clip itself with "on(release)" commands on the buttons. The "onClipEvent" commands are added to the textbox when the scroller movie clip is brought into the slider movie clip.
Is this something that just isn't supposed to work or I am doing some thing dreadfully wrong?
Thanks in advance,
Fakeout
|