Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




File Savvy Movieclips



Would it be better for file size if there was

a) One mc that contained 12 or so images where a gotoAndPlay would be used to direct to the right one

b) 12 movieclips that each had 1 picture

I would assume (a) because the movieclip gets loaded and then that's that... but Im afraid it'll also make it seem like there are 12 instances of the same picture if I have to use that movieclip in 12 different areas

~ Seretha



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-06-2004, 06:09 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

File Savvy Movieclips
Would it be better for file size if there was

a) One mc that contained 12 or so images where a gotoAndPlay would be used to direct to the right one

b) 12 movieclips that each had 1 picture

I would assume (a) because the movieclip gets loaded and then that's that... but Im afraid it'll also make it seem like there are 12 instances of the same picture if I have to use that movieclip in 12 different areas

~ Seretha

ONLY FOR MX2004 SAVVY
I am New in Flash, and trying to link the item numbers (in the code) in a vertical sliding menu to a container.
I can add the number of items but then the (Flashkit) sample does not include the item linking code to a specific container...

ti = 20;
n = 0;
while (Number(n)<Number(ti)) {
set("item" add n, "item" add n);
item0="test"
item1="test"
item2="test"
item3="test"
item4="test"
n = Number(n)+1;
}

Help

Question For Mike Downey.. Or Anyone Who's Mx2004 Savvy
Okay, i've posted this once, but no one read it... lets try a gain with a different title...


Using MX2004 Pro, trying to figure out scripting on the slideshow.
What i'd like to do is assign keys to go to certain screens, like how in powerpoint, you can press 3, and it will got to slide 3.
I have a slideshow setup that displays lyrics for songs to be used with the projector. This will be used in a CD release party at my church this weekend. The arrow navigation works fine, but i wanna try to add this feature as well...
here;s what i got:
code:
keyboard = new Object();
keyboard.onKeyDown = function() {
if (Key.isDown(51)) {
this.presentation.gotoSlide(this.presentation.evry where);
}
};
Key.addListener(keyboard);


whay this should do is go to the slide named "evrywhere" when 3 is pressed on the keyboard.. but it doesnt, so i have obviously script it wrong..

any ideas? If i can get the basic structure down, then i can make if-then or case-switch to go to different slides for other keypresses.

thanks,
-myk

Using Same Xml File On Different MovieClips
hi all,
i have no problems loading and processing my XML file when working on the main timeline, however when i process the same XML on a sub movieClip, flash can not define the XML file previously loaded into the main timeline,
is there a way to overcome this without reloading the xml file again in the sub MovieClip.
many thanks

How To Make Movieclips Play One By One Within One Swf File
Hi everyone,

In the attached document, I have got two movieclips (the text ones) that I want to load and play, and then once they have finished, I wantt he main one to play (the one with all the circles). At the moment, it's all playing at the same time. Can you advise me on how I can achieve this and in particular what it is that I'm missing in my knowledge to be able to do this successfully please?

Your help is appreciated as always.

Use Same Class (.as) File For Multiple MovieClips
I have a class that operates some bar graphs, I want to use different colored bar graphics (movieclips) for different bars. I create a bar and Export to AS with the class myBar. When I tried doing a second one by duplicating my first bar movie clip and assigning the same class flash wouldn't let me. So, I copied and pasted myBar.as to myBar2.as and used that class for the second bar.

I now have 5 different bars and it's getting really annoying changing 5 different AS files when I want to make a modification to the base class.

Can someone offer me a better solution? I tried doing "public class myBar2 extends myBar" but that gave me some weird errors I didn't have the time to track down - I'm using dynamic text fields in the movieclips and there was some error with flash.text.TextField.

Any suggestions or a way to do this would be appreciated.

Actionscript 1/2: Loading Movieclips Posistion From A Txt File Or Xml Doc
Hi there im, currently trying to learn actionscript so go easy on me

I would like to know how to load a txt file that has the xy position of a movieclip and then apply this to the movieclip, I would also like it to be able to add new duplicate movieclips to the main movie (as in copy/paste not literally make a new symbol).

Text file I assume would look like this:

&clipx1=67&clipy1=34&clipx2=108&clipy2=89 (two identical movieclips would be shown)

but could be extended to something like this without changing the main movie

&clipx1=67&clipy1=34&clipx2=108&clipy2=89&clipx3=6 7&clipy3=34&clipx4=108&clipy4=89 (four identical movieclips would be shown)

Im open to example in xml if you could explain it because I have done no work with flash and xml

thx in advance

Loading Multiple MovieClips From One File At Runtime?
I've built an application that I want to customize for different users by including a library of movie clips specially designed for each user. I don't want to have to change the base flash file. This means I need to be able to have two files: a main application file, and then some other file that includes a library of clips. It's important that a collection of clips are available in a single file, not loaded as individual swf's.
If I load an SWF with a bunch of clips in the library, each set for actionscript sharing, will I be able to load those into the original movie?
Is there another way to do this? any help is greatly appreciated.

Dave

Loading Multiple MovieClips From One File At Runtime?
I've built an application that I want to customize for different users by including a library of movie clips specially designed for each user. I don't want to have to change the base flash file. This means I need to be able to have two files: a main application file, and then some other file that includes a library of clips. It's important that a collection of clips are available in a single file, not loaded as individual swf's.
If I load an SWF with a bunch of clips in the library, each set for actionscript sharing, will I be able to load those into the original movie?
Is there another way to do this? any help is greatly appreciated.

Dave

Import MovieClips/Classes From External File
Hey All,
I'm working on an OOP/Class based application. In order to save on filesize, I have some of my assets in another swf file, with their linkage properties set to classes that give them properties and actions:
Class: src.BLNavStation_Circle
Base class: flash.display.MovieClip

Referencing MovieClips Inside MovieClips From The Main Time Line?
is it possible to have event listeners that listen for a movie clip inside a movieclip and then execute a function from the main time line?
Or is it impossible to relate something this far removed? Sounds like a geek Jerry Springer episode!
Something sort of like this:









Attach Code

movie1_mc.closeBtn1.addEventListener(movie1_mc.MouseEvent.CLICK, closeMenu1);
movie2_mc.closeBtn2.addEventListener(movie2_mc.MouseEvent.CLICK, closeMenu1);

function closeMenu1(e:Event):void {
if (e.currentTarget.name == "closeBtn1"){
movie1.gotoAndPlay(27);
movie1.visible = true;
} else if (e.currentTarget.name == "closeBtn2") {
movie2.gotoAndPlay(27);
movie2.visible = true;
}
}

Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..

I have been working on this project that used part of the kirupa.com tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)

Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.

Here is a chunk of my code:


Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}

"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.


Thanks...


EDIT:

I got it working.. I just had to add "_root.movieclipname." in front of the movieclips I referred.

[CS3] Simple Display List Problem (MovieClips In MovieClips)
I have an object called UI_Total which contains 3 objects called Star, instanced as star1 star2 and star3.

In my code I do the standard:

PHP Code:



mainUI=new UI_total;
addChild(mainUI); 




to instance the UI_Total.

Now, I can do something like

PHP Code:



mainUI.star3.x+=500 




no problem.

And when I do

PHP Code:



trace(mainUI.star3.parent) 




I get [object UI_Total] as expected.

Would someone be so kind as to explain to me then why
PHP Code:



mainUI.removeChild(star3) 




doesn't work, and also why I can't do anything like
PHP Code:



mainUI.getChildIndex(star3) 

Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..

I have been working on this project that used part of the kirupa tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)

Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.

Here is a chunk of my code:


Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}

"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.


Thanks...

RollOver Scripts On Movieclips In Movieclips With RollOvers
Hi,
This might get a little confusing so I'll try to explain clearly.
Basically, in Scene1 I have a colored rectangle movieclip with a rollover script that activates its animation e.g. on(rollOver){this.gotoAndPlay(2). That works just fine in activating the rectangle animation,which is just an alpha and tint change.

Within the rectangle movieclip symbol is another movie clip consisting of text graphics that has a similar rollover script placed within its instance within the rectangle symbol.

First of all, this rollover script will not activate when moused over, though the rectangle effect change does.

When I set the text movie clip as a button and place it within Scene 1 rather than within the rectangle symbol, the rollover does work, but it performs a rollOut of the rectangle movieclip. Even though the text button is directly on top of it, the rollOut occurs with the rectangle movieclip when the text button is rolled over.

So maybe you can see what I'm saying here. As part of the first movieclip, an embedded rollover script won't work. As a button placed on that movieclip, the button rollover state interferes with the movieclip rollover script.

I'm sure somebody has encountered this. If I haven't thoroughly confused you, hopefully some charitable soul will help me out.

thanks

Movieclips Within Empty Movieclips...problems
Okay, I'm doing a band web site for my brother and I'm running into this problem...

I want each of the links to be a separate flash file. I understand how to do that and have basic ones working. I have empty movieclips and use the loadMovie function, i.e.


Code:
on(release) {
loadMovie("shows.swf", "shows");
}
The thing is though, the shows.swf file has a textbox which is inside a movieclip which loads an external text file (this is so that they can update the site easily themselves). When I just double click the shows.swf file myself, it opens in the flash player correctly, but when I try to open it from the main.swf file, the shows.swf file loads, BUT the text doesn't appear in the textbox(which is in the movieclip). The movieclip which holds the textbox has an instance name of textbox. I can give you guys the two files if you want to see more if it will help you give me a solution to this problem. I thank you for your time and hope someone can help me.

Michael

Removing Movieclips, Alot Of Movieclips
through a duplicateMovieClip action, i created about 200 mc's named "circleMovie1", "circleMovie2", and so on.

now, how can i delete all these mc's without typing out 200 "removeMovieClip" actions?

plz help!

Movieclips Inside Movieclips Problems
hi.

i have a mc called question13 which holds a number of other mc's inside it on the 12th frame, called tick1-tick6. each of these acts as a simple radio button with the following code (for tick1)...

on (release) {
if (_root.tick1select == 1) {
_root.question13.tick1.gotoAndStop(1);
_root.tick1select = 0;
}
else {
_root.tick1select = 1;
_root.question13.tick1.gotoAndStop(2);
}
}

These work fine as they are.

but i need to set the tick1 to look as though it is "ticked" (ie at frame 2) from the main timeline, not within question13, how do i do this?

Movieclips Play Sounds Of Other Movieclips...
I made a very simply movie comprising of 6 movieclips with sound that play when you press the corresponding key. The top 3 clips play fine but the bottom three play the sound or sounds from previous clips.

also the huskey clip will play when you press either enter or space but it should only be played when you press space. (I was thinking that enter is reserved for playing movies or something.
Thanks for all help.

im using Flash 5

My .fla in a zip file -can be downloaded here...http://www3.telus.net/seanc007/MC_Test.zip

(Too big to be attached)

Checking Distance Between Movieclips Within Other Movieclips
I'm not sure if there is a really quick & dirty way to do this, but I have some movieclips, which are nested within another movieclip, and I'd like to write some code that will return which one is closest to a movieclip on the main timeline. Since there _x's are entirely different because they're not in the same movieclip - is there any way I can make this work?

Thanks!

Target Movieclips From Nested Movieclips...
All,

I was wondering if you could give me a hand?

I have a file that contains two movieclips. One movieclip contains a container clip and the other movieclip contains two nested movieclips which end up with a button. Please see diagram...

I would like for the button, when clicked, to load an external .swf file into the container movieclip which is nested inside a _root movieclip. See diagram...

I have used the following code on my button to no avail:

Code:
loadMovie("Flash/homeIMGs/image1.swf", _root.mainImageMC.imageMC);

AND

_root.mainImageMC.imageMC.loadMovie("Flash/homeIMGs/image1.swf");


Please help.

Movieclips As Buttons Embedded In Movieclips
Hi,

I have a couple movie clips embedded inside a main movie on the root of my movie.

i have an action onRollover applied to the main movie clip, which triggers actions on the movie clips inside it.

i want to use the child movie clips as buttons, but i am getting no response to the code below:


ActionScript Code:
this.mcPic.onRollOver = function() {
trace("rollover");
_root.mcPic.btnBuy.xSlideTo(135, .5, "easeOutBounce");
_root.mcPic.btnListen.xSlideTo(105, .5, "easeOutBounce");
}

this.mcPic.onRollOut = function() {
    trace("rollout");
    _root.mcPic.btnBuy.xSlideTo(360, .5, "easeOutBounce");
    _root.mcPic.btnListen.xSlideTo(-91, .5, "easeOutBounce");
    }

// the following code here gives no response.

this.mcPic.btnBuy.onRelease = function() {
    trace("click OK");
}
this.mcPic.btnListen.onRelease = function() {
    trace("click OK");
   
}

any help would be appreciated.

thanks!
eric

Getting My Buttons Active When Movieclips Are Within Movieclips
Ok so I have this site in progress with these neat drop down menus. When you rollover the image, two or more choices appear that link you to other pages. Only when you rollover them, the buttons don't work. The buttons work when you isolate each movie clip. But once I place the movieclip in the main time line, the buttons don't work anymore. The rollovers don't happen. They aren't clickable.

I need to know how to tell flash to make these buttons work. I can do this if a button is in the maintime line but not when it's embedded in a movieclip which is then embedded in the main time line. Get it?

I uploaded the work in progress so you can see what I mean. www.stephanieerdel.com/headermov.swf

rollover "Vibrations" and you'll see the choices pop up. In the movie clip each choice changes color when you rollover it. As mentioned before, when I put the clip in the main timeline, the buttons don't work. but you see them and the movie clip works fine.

If someone can write out what the code is to let flash know to make these buttons work, I would appreciate it soooo much.

Thank you!

-Stephanie

Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.

What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.

Something along the lines of this:

Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.

Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!

Why Do Movieclips Inside Movieclips Have Different _x And _y Than The Timeline?
I'm confused, why does a MC inside another MC have different _x and _y values than the main timeline?

What I am trying to do right now is animate a MC inside another MC then get the main MC holding everything to move where that new MC ended animating at (it's part of a game I'm making.)

I know it's confusing but Flash shows the cursors current X and Y in the info panel, which is the same as the main timeline. Yet inside the movieclip, an x of 76 and a y of 277 on the timeline is -195 and -30.9 (respectively) inside the MC.

How do I fix it so I can get the _x and _y values to match up so I can tell the main MC to reposition itself to the new X and Y (of the inside MC)

MovieClips Inside Other MovieClips - Detecting All
I have a movieclip called mapWindow, inside mapWindow are dynamically created movieclips of various sizes. The movieclips inside the mapWindow don't take up the entire space of the mapWindow and thus I use a startDrag on the mapWindow upon detection of a mouse press. The problem is, I don't want the start drag to start if the mouse is detected over any of the child movieclips inside mapWindow.

I have a few ideas of how to proceed, but I'm not sure how to reference all child movieclips of a particular movieclip - or something along those lines.

It would be easy to use the hittest function if I knew how to reference all the movieclips I need to, but alas...

Thanks in advance.

Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.

What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.

Something along the lines of this:

Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.

Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!

Targeting Movieclips In Attached Movieclips
I have a movieclip that is linked with the name sound1. Inside this movieclip is another movieclip, a loadBar, that when I place on the mainstage, functions fine. I want the loader to be in the attached MovieClip. I'm having issues with targeting though:


ActionScript Code:
rotateMenu.onRelease = function() {
 mySoundLoading = 0;
 myNewMovie = attachMovie(mybounce, "holder", this.getNextHighestDepth(), {_x:182, _y:125});
this.myNewMovie.loadBar._xscale = mySoundLoading;
trace(this.myNewMovie.loadBar._xscale);
trace(mySoundLoading);}

My first trace comes up undefined...the loadBar doesn't function.
I've tried targeting this.holder.loadBar._xscale.
I've tried targeting without this.
I've tried targeting the name of the linked movie:mybounce....
How do I get to the loadBar within my attached movie??
Thanks.

AS3 - Reading Movieclips Inside Movieclips
hey all. i'm such a noob when it comes to AS3 but i'm determined to learn.

i've had to drop out of strict mode to make this work. can someone tell me why? i've a feeling it has to do with casting maybe. this is in an .as file and not on timeline.

trace(getChildByName("box1").playerStats.x);

in strict it throws up "1119: Access of possibly undefined property playerStats through a reference with static type flash.displayisplayObject."

yet trace(getChildByName("box1").x); works just fine.

also i want to refer to it dynamically with "box"+i. do i use this["box+i].playerStats.x?

edit: trace(getChildByName("box"+playerPos).playerCards.x); seems to work ok!

help!

Targeting Movieclips From Movieclips
I just moved up to Flash MX from Flash 4 and the dot notation is killing me.

My goal is to target one movie clip (mc2) and play a certain frame(lable1) from a button on another movie clip. Normally, I would do an "on release, tell target" and everything would be grand, but my dot notation isn't working properly. It works on the first click but intermittently on further clicks. My code on the button is:

on (release) {
_root.mc2.play(lable1)}

The first time it plays the right lable, the next time I click it plays the next lable on the timeline, next click it jumps to another lable-all within mc2 at least. Each label has stops so that isn't the issue (i don't think)

Is there a better way to do this? Why is this so hard!?!

Controlling Movieclips Within Movieclips-help
i need to tell a movieclip to play but it seems like it won't work becos this MC is embedded within another MC.

it goes like this:

MC1 calls MC2, and within MC2 i need to call out *another* MC (let's call it MC3) with buttons that will call out other MCs. On each button on MC3 i've put this code:

on(release) {
this.gotoAndplay("mymovie");
}

when i publish to movie, the link is active but there's no response when i click on it.

what went wrong?

Loading Movieclips Into Other Movieclips
Hello, not sure if this is possible but...

I've got a random number of dynamically generated movieclips.

I want to put all these movieclips inside a scrollpane.

I realise that I can only have 1 movieclip inside a scrollpane, so

how can I load each of these random movieclips into my container clip?

Cheers for your help

Detecting MovieClips On MovieClips
If you have object1, say a movie clip and its dropped onto object2 another movie clip, object2 is now the droptarget of object1. Am I correct?

Is there any way to access object1 from object2. Say, give me the object that is on top of object2.

And is there any way to determine if an object has any objects(doesn't matter what object) on top of it?

Movieclips Inside Movieclips
hi.

I am having problems with my game. I want to make bombs and for this i needed a movieclip 1 inside movieclip 2. When movieclip 1 is touched by the player the movieclip 2 plays. I have had no success so far and i cannot use such things as nameing the bomb as it wil take too long because i would like to c +p loads on the game.
Here are the codes i have tried:

code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.play ();
}
that made the main frame change.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
play ();
}
this did nothing
i also tried this but it did not work.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.this.play ();
}

Have you got any ideas? i tried to provide code and my errors like i must. thanks

[F8] Movieclips Within Movieclips Probs
another super long one!
on my main timeline sits a moviclip called photobook. Its first frame is empty except for a transparent button, which when clicked, 'opens the book' by going onto frame 2, a page from the book
inside this clip laid out on the 'pages'are six other clips, they appears as 'newscuttings' in the scrapbook which is my photobook clip. I have scripted it so that when the user clicks on one of the six clips, they see a larger version of the newscutting image. I have achieved this by placing a larger version of the image in a layer above the original image, all contained in the 'newscutting' clip. The I created a 2 frame clip called 'papermask' the first frame containing some invisible shape, the second containing the mask shape which covers the larger version of the image. i placed this 'papermask' clip in a layer above the larger version, and turned masking on.
then I applied the following script to the newscutting movieclip:

on (release) {
this.papermask.gotoAndStop(2);
_parent.closeBtn.gotoAndPlay(2);
}
the second line refers to a 2 frame clip which acts as a close button to the enlarged image. the second frame contains the close button, so when the enlarged image appears, so does the close button.
the close clip has the script attached to it:
on (release) {
_parent.newscrap1.papermask.gotoAndStop(1);
this.gotoAndPlay(1)
}
It closes the image by going into the mask clip and returning the playhead to the first emppty frame, hiding the big version from view. it goes to its own first frame, hiding itself from view.

Right, now i get to the point!!
This all works, I can see a larger version of my news cutting image by clicking on movieclip, and can close it by clicking the close clip.
the problem is, when i click a close BUTTON which closes the parent "photobook" clip by returning it to its first, invisible frame, the 'newscutting' clip that i have clicked on stays there, even though it is inside the 'photobook' clip and should not be there, as it does not exist in the first frame if 'photobook' !
I tried attaching this to photobook's close button:
on(release)
{_parent.newscrap1.gotoAndStop(1);
gotoAndPlay(1);
}
but no luck!

i know this is a bit of an essay, but i wanted to give as full context as possible so someone could give me some hints!

Loop Through Movieclips Within Movieclips
Hi guys, I ve checked everywhere but I cant find the simple answer to this. I just need to be able to control different movie clip from a loop. The only difference between this and what all the turorials tell me is that my Catergory buttons are within the scope of another movie clip..ShopCatergories..I would have thought the following code should work but I does nothing.


Code:
var temp_mc;

//I put this one in just toe check if I can manually stop on of the
//animations..this works fine.
ShopCategories.CatButton1.stop();

//But none of these stop playing??
for (var i = 0; i<3; i++)
{
temp_mc=["CatButton"+i];
trace(""+temp_mc);//traces the correct thin eg..CatButton1 etc
ShopCategories.temp_mc.stop();
}

Movieclips Interacting With Other Movieclips
I am creating an AS3 Flash CS3 project that moves shapes to other shapes. I have created movieclip buttons, when one clicks on the button a shape connects to another shape. Each button has its own layer and within that layer lies two additional layer. One layer for the actions and another layer for the button states.

I am now trying to disable one button while another is enabled or in the down state.

I have tried listening for the state of the other button, root paths, and every other option that I could find on the net, but with no avail.

Controlling Movieclips Within Movieclips
I have a button on my root scene which I want to control the timeline of a movieclip that is an object with a movieclip on that root scene. Basically-


Scene 1 -> Movieclip (archMC) in 'Scene 1' -> Movieclip (picnavi) in 'archMC'

I want a button on Scene 1 to change the timeline head to go to frame 1 on the movieclip 'picnavi'. And I only have about 6 hours to figure out how to do it!

Controlling Movieclips Within Movieclips-help
i need to tell a movieclip to play but it seems like it won't work becos this MC is embedded within another MC.

it goes like this:

MC1 calls MC2, and within MC2 i need to call out *another* MC (let's call it MC3) with buttons that will call out other MCs. On each button on MC3 i've put this code:

on(release) {
this.gotoAndplay("mymovie");
}

when i publish to movie, the link is active but there's no response when i click on it. i think it could have targetted it wrongly.

can someone help me pleeeease!

aryastark

Loading Movieclips Into Movieclips
what i want to do is have one movieclip load and play certain movie clips whenever a certain button is pressed. i am doing this in my video game, as when u press left, it will load the left walking animation and play it while it moves, then when u release the left arrow key, it will load the standing still animation.
any help would be appreciated!

Accessing Movieclips Within Other Movieclips?
Greetings,

I appreciate you taking the time to look at this problem i am having.
I am still transfering from AS2 to AS3 and right now i am having a very annoying problem.

THE STRUCTURE:
Maintimeline contains 2 buttons that i want to use to access children in a bunch of movieclips.
rectangle_mc has circle_mc circle_mc contains xx_mc xx_mc contains wtf_mc

placed on frame 1 on maintimeline

Why can't flash see my nested movieclips? I remember in AS2 you could go down the line:
_root.movieclipA.movieclipB.movieClipC.movieclipD. movieclipE.gotoAndPlay(frame#);

Any Help Appreciated Thanks,










Attach Code

stop();

function playTimeline (evt:MouseEvent):void {
this.rectangle_mc.gotoAndPlay(2);
}
start_btn.addEventListener (MouseEvent.MOUSE_DOWN, playTimeline);

/*This code errors out*/
function EndTimeline (evt:MouseEvent):void{
this.rectangle_mc.circle_mc.xx_mc.wtf_mc.gotoAndPlay(2);
}
stop_btn.addEventListener (MouseEvent.MOUSE_DOWN,EndTimeline);

Movieclips Talking To Movieclips?
Hi,

Probably a silly question (had a few late nights!!)...

Can I communicate between movieclips?

I have a movieclip containing some buttons but I would like the buttons to tell another loaded movieclip to do something?

Im not sure what to put before the gotoandplay option ie:

on(press){

......... gotoAndPlay("text");
}

etc

Thanks

Spence

Referencing Movieclips Within Movieclips
ok heres the problem:

I have a movieclip which is a button, and this button is inside another movie clip, and this movie clip is within the main movieclip, soo

mainMenu ----> subMenu ----> buttonMenu

how would i reference the button in buttonMenu so that when it is released it goes to requeid frame.

i tried:

_root.mainMenu.subMenu.buttonMenu.onRelease = function() {
required actions
};

but it doesn't work. I'm sure i'm missing something pretty simple but been looking at it for ages now and its just gone blurry.

I've assigned al lthe movieclips instance names.

Many Thanks

Sean

More Problems With Movieclips In Movieclips
I have the next code:

Im trying to make a preloader for the image that gets loaded in a movieclip called picholder,

Now the problem is that i get undefined back for the image ,
so i cannot preload what is not there hehe

and im not sure what im doing wrong .
In my other fla the image passes fine and the code is the same

trace(tes.picholder);

gives me back undefined
where tes is the movieclip i created for each item
picholder is the movieclip where the picture goes in.
(i have put stop() in there and taken it out to test but with no luck)
The code is


Code:

MovieClip.prototype.makeVisible = function() {
clearInterval(this.interval);
this._visible = true;
this.play()
};



function LoadPicInMovie (thepic ,wherein)
{
//wherein._alpha = 0;
trace (thepic);
trace (wherein);
var totalbytes = wherein.getBytesTotal();
var loadedbytes = wherein.getBytesLoaded();
var percentloaded = Math.ceil((loadedbytes/totalbytes)*100);
trace(percentloaded);

wherein.preloadertxt.text = percentloaded;
if (percentloaded == 100)
{

wherein.loadMovie(thepic);
}
}
function clearAll() {
for (var obj in moviecl) {
if (typeof moviecl[obj] == "movieclip") {
clearInterval(moviecl[obj].interval)
moviecl[obj].removeMovieClip();
}
}
}

function AttachMc(counter)
{
tes = GalleryContainer.attachMovie("Holder","item"+counter, counter);
return tes;
}

function List (howmany,Arr)
{
counter = 0;
item_spacing = 160;
luck = 0;
row = 0;
for (var g=0; g < howmany ; g++)
{
var tes = AttachMc(counter);
trace(tes);// fine
LoadPicInMovie(Arr["Clientimages"][g],tes.picholder);
trace(tes.picholder);// undefined

if (luck == 3)
{
row++;
luck=0;
}


tes._x = luck * item_spacing;
tes._y = 140 * row;
trace (counter);
tes.stop()
tes._visible = false;
tes.interval = setInterval(tes, "makeVisible", 500*g);


counter++;
luck++;
}
}
function PutInArray(my_xml)
{
/*
* This function reads the xml file into an array
*
*/
var item_count = 0;

// start with the first item in the XML
var items = my_xml.firstChild.firstChild.childNodes; // menu -> menuitems -> child nodes array
var total = items.length
// create arrays for the values
var TheClients:Array = new Array();
TheClients["Clientids"] = [];
TheClients["Clientnames"] = [];
TheClients["Clientdescriptions"] = [];
TheClients["Clientimages"] = [];
TheClients["Clientdates"] = [];
TheClients["Totaal"] = total;
for (var i=0; i< total; i++) {
// only continue if the type of this item is a squirrel
// create variables for our elements
var clientid = items[i].firstChild; // same as items[i].childNodes[0]
var clientname = items[i].childNodes[1]; // second child node
var clientdescription = items[i].childNodes[2];
var clientimage = items[i].childNodes[3];
var clientdate = items[i].childNodes[4];

// add to array

TheClients["Clientids"][i] = clientid.firstChild.nodeValue;
TheClients["Clientnames"][i] = clientname.firstChild.nodeValue;
TheClients["Clientdescriptions"][i] = clientdescription.firstChild.nodeValue;
TheClients["Clientimages"][i] = clientimage.firstChild.nodeValue;
TheClients["Clientdates"][i] = clientdate.firstChild.nodeValue;
item_count++;

}

return TheClients;
}

// start procedural code
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if (success){
Client = PutInArray(my_xml);
List (9,Client);
trace(this);
} else{
trace('xml file not loaded');
}
}
my_xml.load("portfolio.xml");
stop();

Thanks in advance

Luck

Events On Movieclips Under Other Movieclips?
I have two movie clips added at runtime. For aesthetics, the one NOT listening for any mouse events has to be on top. I have a second clip that gets added beneath the first one; I'm trying to figure out how I can get the one "underneath" the first to listen for mouse events -- essentially, I want the "top" movieclip to be "invisible" to the mouse.

Both of these clips are on the same parent clip, if that makes any difference. Clear as mud? I'm sure this should be simple, but Flash has been beating me up all day and my brain is fried. Thanks for any help!

Movieclips Talking To Movieclips?
Hi,

Probably a silly question (had a few late nights!!)...

Can I communicate between movieclips?

I have a movieclip containing some buttons but I would like the buttons to tell another loaded movieclip to do something?

Im not sure what to put before the gotoandplay option ie:

on(press){

......... gotoAndPlay("text");
}

etc

Thanks

Spence

Images Inside MovieClips Inside MovieClips
Hi. I'm trying to create a virtual photo album that you can drag photos into and rearrange them etc. The plan is to have it load/saveable using XML

In my library I have two MovieClips called Page and Photo.

Page is supposed to be able to contain many Photos. A Photo is supposed to hold or be an image (a photo).

I have declared two classes, Page and Photo, which are linked to their respective MovieClips

Actionscript:

class Page extends MovieClip {

private var _photo1:MovieClip;

function Page(){}

public function addPhoto(){
attachMovie("Photo", "_photo1", getNextHighestDepth());
_photo1.loadPhoto("File0025.jpg");
}
}

Actionscript:

import mx.controls.Loader;

class Photo extends MovieClip {

private var _photoLoader:Loader;

function Photo(){}

function loadPhoto(url){
trace("Inside Photo trying to load " + url);
_photoLoader = new Loader();
_photoLoader.load(url);
}

public function onPress(){
this.startDrag();
}

public function onRelease(){
this.stopDrag();
}
}

However, I can't get an image to show. The Photos have to be draggable so they have to be MovieClips. I can't use loadMovie() because I have to abe to control the size of the image. I'm trying to use Loader but I can't get it to work.

Question: What is the best way to allow my Page obj to have draggable images (which I'm trying to do as Photo objects)? I figured it has to use a Loader component.

Advice?

Automatic Update In Flash File(.swf File) When There Is Any Change In A .txt File
i have a site(intra) in my college for displaying notices.the clerk is completely ignorant of flash.he knows how to type the text in notepad.so whenever he changes the .txt file it should get updated in the flashfile automatically.

so anybody please help me in solving this problem..

kiran

[Edited by kiranwizz on 04-16-2002 at 05:25 PM]

Loading An AS2 SWF File From An AS3 SWF File, And Getting Some Parameters In AS2 File
This is my ActionScript 3.0 code:

Code:
var ldr: Loader = new Loader();
var upldata = "testabc=test1";
var v: URLVariables = new URLVariables(upldata);
var r:URLRequest = new URLRequest();
r.url = "as2.swf";
r.method = URLRequestMethod.POST;
r.data = v;

trace("loading", r.url);
ldr.addEventListener(Event.COMPLETE, fnccomp);
ldr.addEventListener(IOErrorEvent.IO_ERROR, fncerr);
function fnccomp(ev: Event) {
trace("complete");
}
function fncerr(ev: IOErrorEvent) {
trace("error", ev);
}
ldr.load(r);
addChild(ldr);
In the as2.swf file, there are two trace commands (using ActionScript 2.0 for this Flash file):
trace("as2.swf " + _root.testabc);
trace("_level0.testabc: " + _level0.testabc);


This outputs:

Code:
loading as2.swf
as2.swf undefined
_level0.testabc: undefined
Changing this line:
r.method = URLRequestMethod.POST;
to
r.method = URLRequestMethod.GET;
results in:

Code:
loading as2.swf
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
So, how to do this correctly so that I can access the "testabc=test1" variable/value from the as2.swf file?

Copyright © 2005-08 www.BigResource.com, All rights reserved