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




Movieclip Within A Movieclip Button Issue



The 2nd box is the one with the movieclip in it. When you rollover the box (keep in mind that your cursor has to remain on the box in order for the entire movie to play), it animates. When the box animation is complete the second movieclip plays. it plays the first logo, but the next and previous buttons don't work. How do i get the next and previous buttons to work? The fla is belowwww.geocities.com/demetriusmcclain/services.fla



Adobe > ActionScript 1 and 2
Posted on: 02/23/2007 03:54:42 PM


View Complete Forum Thread with Replies

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

Odd Issue With A MovieClip Button
I have a MovieClip button problem that I absolutely cannot figure out.

I'm working in Flash 8 Pro, AS 2.0. The clip, "btn_mc" is nested 3 deep (_root.Node1.Panorama1.btn_mc). I have a script on the instance that reads
thusly:

[as]
onClipEvent(mouseUp){
_root.N1_N2();
trace("exit1");
}
[/as

The function "N1_N2" resides on the first frame of the root timeline. At first glance, the button seems to work fine, but the trace command outputs the string "exit1" twice. Additionally, it appears that the button is not what I'm clicking. I can click anywhere in the movie, and N1_N2 is called.

What's worse, I need to place more than one of these buttons into the movie. Once I do that, things get really screwy. Say I put in a second button that calls function N1_N6 and outputs "exit2." Once a mouseUp occurs on either button (or the parent movieclip, for some ungodly reason), I get an N1_N6 function call and trace output of "exit 2, exit1." I'm stuck. What am I doing wrong? Thanks in advance for any help!

An Issue With A Movieclip Button
I have recently found a tutorial on how to make an animated button entirly through the use of a movie clip.

The tutorial is great up to the point where it does not explain how to apply a hit space and how to link the button to a later point in the main timeline.
The Button works pefectly. the animation finishes even when the mouse is pulled away. On a lables layer I have labled frames _over and _out.
For the sake of practice all i want to do is get my single button to jump to a later point on the timeline where i have changed the background colour.

This is the action script applied to the button. everything between double inverted comers I have added after to try and make it work.

this.button_mc.onRollOver = function() {
button_mc.gotoAndPlay("_over");
}

this.button_mc.onRollOut = function() {
button_mc.gotoAndPlay("_out");
}

""this.button_mc.onPress = function() {
button_mc.gotoAndPlay(frame, 96);
}""

(made with AS2 in ACS3)
If im not explaining this properly could you advise me in what information i am missing.

Thanks for any advice given

Oli Lyndale

Movieclip Button Issue
I made some movieclips into buttons that will basically link to another page. Inside this button it has text and all. But the problem I have is when I go to the edge of the buttons they begin to animate extremely fast back and forth from the over state and the up state. What should I do to cure this issue?

Major Issue: MovieClip Inside Movieclip Will Not Have MouseEvents?
Hey guys, I got this empty MovieClip i add to the stage called 'container'. In container, I also dymaically add warrior(), warrior2(), and warrior3(). Now Im trying to add my rollover state for warrior, however, it never works?

When I place the warrors inside of a container in design time and then attach the code and place it on the stage, it works? Any Ideas?

public function addHitState(container:MovieClip, linkage_name:String, id_name:String):void{
var class_definition:Class = getDefinitionByName(linkage_name) as Class;
var added_clipisplayObject = new class_definition();
added_clip.name = id_name;
container.addChild(added_clip);
added_clip.x = 1151.2;
added_clip.y = 407.8;

added_clip.buttonMode = true;
added_clip.addEventListener(MouseEvent.ROLL_OVER, rollOverFunction);
};

private function rollOverFunction(event:MouseEvent):void{
trace("@");
};

Nested Button Within Movieclip Issue
Hi,

I have buttons within a movieclip that display when rolling over the movieclip. The instance name of the moveclip is link1. However, once the buttons display, I'm not able to do anything with the buttons. I know from other posts that nested instances of onRollovers will not work but I haven't seen a clear work-around for what I'm trying to do. I've tried unsuccessfully using hittest, so if that's an option, a suggestion on how to correctly incorporate that would be greatly appreciated (or point me in the direction where there's a tutorial on this-I'd be happy to write up the solution and include here once resolved).

Below is the code which I have on an actions layer in the main timeline. As I mentioned, link1 is the instance name of the movieclip and btn_about is the instance name of one of the buttons that when clicked I want to go to another frame on the main timeline. I've also included a link to the swf to show what I'm trying to do.

link1.onRollOver = function() {
link1.gotoAndPlay("show");
}
link1.onRollOut = function() {
link1.gotoAndPlay("hide");
}

btn_about.onRelease = function() {
trace("release button About");
_root.gotoAndPlay("About");
}
btn_about.onRollOver = function() {
trace("rollover button About");
}

http://ekmstudios.com/nestedInstanceSample/rolloverSample.html

Rollover Movieclip/button Issue
okie so...i haven't really searched for another similar post, but then again..i don't know what to search for... basically, i have this animated button, pretty similar to what lee did...it's after his idea, you know... but i'm having some trouble... so onRollOver, onRollOut..i did it differently. i had the movie clip containing the background square, a graphic, and then, a button with the text in it, and the on(rollOver/Out) actions applied directly to the button. when the button reaches that middle area, when i click it, i want it to play some labeled frame... but..it won't..i've tried a whole lot of things, but i'm not sure i tried them in the right way, or all of them, for that matter...

here is the file
http://download.yousendit.com/B446101C47D28E01
(in lack of better hosting ideas)

so...any help is welcomed...

cheers

Control A Nested MovieClip From A Button Component Inside A Seperate MovieClip.
I am a beginner in using Flash and Action Scripting.

This is the Scenerio:

I want to control a movieclip that is inside of another movie clip.
I control it from a button component that is inside of a seperate movie clip.

test = button component instance name
test1 = function
test2 = Movieclip instance name
test3 = Movieclip instance name
testbutton = movieclip name where button component is located

I am able to control a movieclip on the main timeline with the following AS 3.0:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.gotoAndPlay(2);
}

I want to control a movieclip inside MovieClip1.

I tried this:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.test3.gotoAndPlay(2);
}

The movie loaded fine when I tested but got this error when I pressed the button:

TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::testbutton_26/test1().

Please help!!!!!!!!!

Loading A Movieclip On The Main Stage From A Button Within A Movieclip - Big Headache
Hi there,

i am trying to put together a portfolio site, which uses a 'floating' panel with buttons on it. In order for it to move around it has to be a movieclip. So all the buttons are stored within a single movieclip, which is giving me a headache because i want those buttons to load other movieclips from my library onto the main stage (as like a popup window within the flash)

Its all slightly confusing. i have tried using this code based within the movieclip where my button is based:

button_play.buttonMode = true;
button_play.addEventListener(MouseEvent.CLICK, OpenBox);
function OpenBox (e:MouseEvent):void{
this.addChild(new mc_box());
}


button play is within a movieclip called mcTweenMe2 (which is on the main timeline) and i want the movieclip to be loaded on the main timeline (not within in the movieclip where the button 'button_play' is based) mc_box is the movieclip i wish to load on the main timeline (in the centre) with the ability to close it also!

Bit of a headache, please help me someone i have run out of sites to look for answers!

PS: does anyone know why stop (); wont stop my timeline playing like it used to in AS2? beacause another option for making my site work is making this button target labeled frames in the main timeline, however stop (); don't seem to work now!

Thanks!

[F8] Control Movieclip From Button Inside Another Movieclip
ok. I have the Main Timeline..on the stage i have "side_menu_mc" inside that i have "menu_menu_mc"."slider" is menu_menu_mc's Instance name.

Inside "menu_menu_mc" i have a button (services_btn)."button_1" is its instance name. Upon clickin on this button, i want a frame labelled "services" (frame 18) in "side_menu_mc"'s timeline to display.

i attempted this.after some googling.but it does sweet nothing.


Quote:





Originally Posted by my shizer code


menu_menu_mc.services_btn.onRelease = function() {
trace("button pressed");
_root.gotoAndStop("services");
}

Whats The Script For A Button In A Movieclip Within A Movieclip?
Hi

Whats the script for a button in a movieclip within a movieclip?

I have the following but the link will not work?

on (release) {
tellTarget(_root) {
getURL("http://www.google.com", "_self");
}
}

Whats The Script For A Button In A Movieclip Within A Movieclip?
Hi

Whats the script for a button in a movieclip within a movieclip?

I have the following but the link will not work?

on (release) {
tellTarget(_root) {
getURL("http://www.google.com", "_self");
}
}

How To Make A Movieclip Button Open Another Movieclip?
What is the code to make a movie clip button....when pressed...open or plays another movieclip...example...

i have a button..and its a movie clip with roll over and rollout effect..once pressed...how do i make it link to an outside movieclip...(outside the buttons layer)

Button Inherits Movieclip And Movieclip Button Properties
Hi,

I am working on a component to blur pictures and use it as buttons. I got it all working but found something I do not completely understand. May be somebody knows the answer. Since movieclips can also be used as buttons I started to define a new class (I show only fractions of the script):


PHP Code:



MovieClip.prototype.createBase=function(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad){

and so on...

}
    if(tPress){
        tRover=false;
        tLoad=false;
        this.onPress=function(){
            //count will advance here.
            count++;
            //first we fade out the pic
            fadeOut();
        }
    }
    if(tRover){
        tPress=false;
        tLoad=false;
        this.onRollOver=function(){
            count++;
            fadeOut();
        }
    }
    if(tLoad){
        tRover=false;
        tLoad=false;
        this.onLoad=function(){
            count++;
            fadeOut();
        }
and so on..

Button.createBase(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad);




Actually "button" is the name of a movieclip, which inherits the new properties. I can now put instances on stage and write something like:
button1.onRollOver=function(){
this.Button.onRollOver();
}
button1.onRelease=function(){
textField.text="This is button 1 in action.";
}
This will do all what is supposed to do.

But when I change the name of the Movieclip to "myBut", it only performs the blurring but I cannot use it as a button any more and onRelease does not work. In other words if we name a movieclip "Button" or "button" it will automatically inherit button properties. Is that the case? Anybody heard of that?

Playing A Movieclip From A Button In Another Movieclip?
i have a mc with a button in it. when i click the button, i want another mc to play 'over the top of it'

i think this is to do with levels (is the second mc at level1 or 2? and how to i target it from my button (with actionscript?)

thanks in advance

Align A Movieclip To A Button/another Movieclip?
Hey guys
I have a movieclip that contains a MC which my user has created a dynamic polygon and a button. I can scale the button to the same size as the polygon MC but cannot figure out a way of aligning the button - anyone got and suggestions?!?
Thanks in advance
Ol

Control Movieclip From Button In Another Movieclip
I've been searching and searching for the answer to this newbie problem, but I can't find it, so I hope someone won't mind pointing me in the right direction.

I have 5 buttons within movieclip (1); movieclip (1) is located on the main timeline. I'm trying to get the buttons to jump to a certain frame of movieclip (2) which is also located on the main timeline.
The code I've been using for, say, the first button is:

Code:

Code:
on (release) { _root.mainwindow_rooms.gotoAndPlay("lounge"); }
"mainwindow_rooms" is both the library name and the linkage identifier of movieclip (2). It doesn't have an instance name on the stage (is that relevant?)

I can't get this to work. Can someone please help me with this? I have no idea what I'm doing wrong, I'm not very good with Flash.

[F8] AS2.0 Problem With Movieclip Used As Button Within Another Movieclip.
Hi Guys

Ive been battling with a problem in my flash script.

I have a button on the _root that is setup for the onrelease event. when the on release event happens another movie clip also on _root that contains 3 movieclips inside plays a tween motion moving the movieclips into place(its a fly out menu).

the problem im having is that none of the on events are working, Im not even getting a hand over the movieclips, I have given everything the correct instance names but no luck. I do get the onRelease to work if i remove the tweens and have only the movieclip on the first frame.

I have attached my file for further investigations.

All help would be appretiated.
Regards
Pixel

Playing A Movieclip With A Movieclip Button
I am using AS 2.0 I have an animated movieclip (holder_mc) that contains 4 buttons (one is profile_btn). I also have a seperate movieclip named profileTitle_mc. I guess my question is how do I go to different frames of the main timeline from a button inside a movieclip? Right now, holder_mc is on frame 2 of the main timeline and profileTitle_mc is on frame 3 of the main timeline. I've switched the code around a lot, but I can't get the button to switch to the 3rd frame.

this.buttonHolder_mc.profile_btn.onRelease = function() {
this.gotoAndPlay(3);
};

If there's a better/easier/foolproof way of doing this please inform me

Thanks!

How To Use A Button In A MovieClip To Load A Swf Into A MovieClip
Hi,

I'm trying to use a button contained in a movie clip on the stage to load a SWF into another movie clip on the main stage. I have gotten it to work when attaching the action script directly to the button, however I would like to have all my action script contained in one frame. Any ideas on how to accomplish this?
I'm using ActionScript 2.0

Thanks,
Adam

Help With Movieclip/button Containing Sub Movieclip/buttons
Hi Im trying to create a certain type of button.
An example of this type of button can be seen on the navigation on the following website:
www.minipixel.com

The rollover button contains a movieclip and inside this movieclip ther are several other rollover buttons which lead to other sub-movie clips.
Does anybody have a similar working example so as I could look at the actionscript I cant seem to find anything online?
All help would be much appreciated...

Directing Movieclip With Button Outside The Movieclip..
Hello I've got a very simple question where I cant really find an answer to. I've checked my old files to see if I did it before, but I couldn't find anything. Here it goes:

On the mainstage I have a button and a movieclip. If I press this button I want the movieclip to gotoAndPlay a frame which I labeled "one". The thing is however that I forgot the code for the button to do this.


Code:

on(Press){
gotoAndPlay("one");
}
I know something has to go in front of gotoAndPlay but I forgot what. The movieclip's name is symbol 1, and its labeled movie. I also posted the simple flash file.

http://www.xs4all.nl/~karhen/Flash/

This problem should not be very difficult to solve, and it would really help me in developing future websites. Who has the answer??

Movieclip On Top Issue
Hi everybody,

here it comes:

I tried to create two MCs, both with there own tween. while you are "rollover" on one of the clips the tween is playing.

-------------------------------
on (rollOver) {

aktiv = true;

}
on (rollOut, dragOut) {
aktiv = false;
}
-------------------------------

when u leave the MC it reverse it self
-------------------------------

onClipEvent (enterFrame) {
if (aktiv) {
nextFrame();

} else {
prevFrame();
}
}

--------------------------------




The first MC is called: "mc"
The secound one "mc3"


And here is my prob:

MC3 works perfectly. While mc3 is expandig it covers "MC".
The other way round does not work right: While "MC is expanding" it DOES NOT cover "MC3".

Does anyone know how to slove this problem? More on a solution would be fine which also works for more than two MCs!

I have embedded the FLA if that helps somehow!

Thanks a lot!

phoenix

Movieclip Issue
hi ppl,

I am hoping someone might be able to help me? I am really having some trouble with a movie clip in flash.

The idea is bubbles which are animation with a simple motion tween to loop up the page. Inside the movieclip is a button, which I wanted to add the effect of moving bubbles up the page and with a button state burst the bubble with a sound sample to play. However this doesnt work right because the movieclip is moving at the same time we want to click on it. Can anyone help me I am so stuck.

Movieclip Issue
hi ppl,

I am hoping someone might be able to help me? I am really having some trouble with a movie clip in flash.

The idea is bubbles which are animation with a simple motion tween to loop up the page. Inside the movieclip is a button, which I wanted to add the effect of moving bubbles up the page and with a button state burst the bubble with a sound sample to play. However this doesnt work right because the movieclip is moving at the same time we want to click on it. Can anyone help me I am so stuck.

MovieClip Issue
How do you prevent a movie clip from playing again...after you have switched scenes?

Stop MovieClip Issue
In my code I am trying to stop my main timeline and the timeline of the movieClip. But I am having trouble getting the code to work.


Code:
on (release) {
//trace("test");
//trace the currentFrame of the mainmovie
trace("currentframe"+this._currentFrame);
_root.gotoAndStop(this._currentframe);
_root.VSound.stop();
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
//trace currentFrame of movieclip
trace((_root[i])._currentframe);
//((_root[i]).gotoAndStop(_currentframe))
((_root[i])._currentframe).stop;
}
}
}

Movieclip Link Issue
http://www.yousendit.com/transfer.ph...F6DA0B03F31248

Whats up with my simple slideshow?

I created 3 movieclips with animation. (ad1_mc,ad2_mc,ad4_mc)...and I gave 3 functions...1 and 2 are working but not the 3rd one...to test this...I created 3 movieclips without animation (symbol1,symbol2,symbol3) and tested it ...it works fine...Please someone check it out....Thanks

Movieclip Link Issue
movieclip link issue

--------------------------------------------------------------------------------

http://www.yousendit.com/transfer.p...6F6DA0B03F31248

Whats up with my simple slideshow?

I created 3 movieclips with animation. (ad1_mc,ad2_mc,ad4_mc)...and I gave 3 functions...1 and 2 are working but not the 3rd one...to test this...I created 3 movieclips without animation (symbol1,symbol2,symbol3) and tested it ...it works fine...Please someone check it out....Thanks

MovieClip.prototype Issue
Hi there,

First of all, if you really want to help me, please don't:

1. question my approach (taken out of context to focus on the problem)
2. suggest a workaround


My problem: I've got the following code:
code: MovieClip.prototype.sequence = function() {
_root["Button"+i].onRelease = function() {
this.gotoAndStop("active");
};
};
for (i=1; i<=4; i++) {
_root["Button"+i].i = i;
_root["Button"+i].sequence();
}
This code works fine. However, for some reasons which I do not wish to elaborate on, I need to replace this code with code: MovieClip.prototype.sequence = function() {
_root["Button"+i].onRelease = function() {
_root["Button"+i].gotoAndStop("active");
};
};
for (i=1; i<=4; i++) {
_root["Button"+i].i = i;
_root["Button"+i].sequence();
}
since I need the absolute path. Only exchanged the highlighted area. Now it doesn't work any more; - question: why not?
What can I do to make it work? In case of confusion, view attached file.
Help appreciated.

Issue Extending Movieclip
Hello,

So I have a class Category which extends MovieClip. (here's my .fla)

I'm designing a dynamic flash menu, and as such each category will have a category name. Everything works fine and dandy in my code, i create a Category and feed it all the attributes I need, until I run the metthod attachMovie( ... ) . Right after I run attachMovie( ... ) , suddenly everything from my Category class is undefined. (Below is my code in the navigation, sorry for the length.. but may as well be complete):


Code:
/* Flash Navigation Actionscript
*
* This sets up a sliding style flash navigation for the Lazzarus website.
* @author:Brandon Visser
* @date:August 2006
* @ver:1.0*/

var categories:Array;// main category object
categories=new Array();

/* Step 1: Read category logic in from database or flat file */

// ToDo: For loop to read data in from database/flat file (however you're doing it)

// category logic


categories[0]=new Category("Category 1", 1);
categories[0].addSubCategory("sub 1, 1", 0);
categories[0].addSubCategory("sub 1, 2", 1);
categories[0].addSubCategory("sub 1, 3", 2);


categories[1]=new Category("Category 2", 1);
categories[1].addSubCategory("sub 2, 1", 0);
categories[1].addSubCategory("sub 2, 2", 1);
categories[1].addSubCategory("sub 2, 3", 2);


categories[2]=new Category("Category 3", 1);
categories[2].addSubCategory("sub 3, 1", 0);
categories[2].addSubCategory("sub 3, 2", 1);
categories[2].addSubCategory("sub 3, 3", 2);


// end category logic

/* Step 2: Position/Place categories */

var ypos:Number; //default Y position to offset
ypos=10;

var buttons:Array = new Array();
var tmp:MovieClip;
var id:String;
var cn:String;

for (i=0; i<categories.length; i++) {
cn=categories[i].getCatName();
id="category"+(i+1);
trace(categories[i].getSubArray().length);
Object.registerClass("categoryButton", Category);
categories[i]=this.attachMovie("categoryButton", id, i, {_x:2, _y:ypos+i*25});
trace(categories[i].getSubArray()[2]);
categories[i].categoryname.text=cn;


categories[i].onPress=function() {
var subs:Array;
trace (this.isCatOpen());
trace(this.getSubArray().length);
}
}
I'm at a loss, and have literally spent days spinning my wheels without getting anywhere. If anyone can offer insight into what it is I'm doing wrong, well then they would be king(/queen?).

I'm lovin actionscript and flash, but I seem to keep hitting these roadblocks

Thanks,
- Brandon

Nested MovieClip Issue
This should be an easy one for you experts out there!

All i want to do is to have the parent movieclip to have an image within it
as well as having a nested movieclip with an image within itself as well.

The problem is I only get the image within the child movieclip to show!
the parent's image does not show up!

Here is the code that I have been fiddling with:

content.createEmptyMovieClip("mcHolder", content.getNextHighestDepth());
content.mcHolder.loadMovie("frame.swf");

content.mcHolder.createEmptyMovieClip("mcJPEG",1);
content.mcHolder.mcJPEG.loadMovie("MCM/thumb.swf");

...any suggestions?...please? (only thumb.swf shows)

Movieclip Resizing Issue.
Hey everyone

I've got a minimap which i'm creating dynamically. It fits 3 by 3 "rooms", and i'd like to make it expandable so it can fit more.

So far i've got it so that it goes from it's 90 by 90 size to being about 700 by about 500. It scales the inner parts of it so it appears to just increase how much you're seeing. Everything works fine. Except, for some reason, the map changes size at random, almost.


ActionScript Code:
} else {
        _root.Map._x = 10;
        _root.Map._height = 545;
        _root.Map._width = 768;
        _root.Map.player._xscale = _root.Map.Map._xscale=(90/_root.Map._width)*100;
        _root.Map.player._yscale = _root.Map.Map._yscale=(90/_root.Map._height)*100;
        _root.Map.Map._x = -30*_root.x*(_root.Map.Map._xscale/100)+45;
        _root.Map.Map._y = 30*_root.y*(_root.Map.Map._yscale/100)+45;
        _root.Map.state = 1;
    }

As you can see, i've hard-coded in the height and width of it, and as far as i'm aware that should make it be a certain size. However as i said, when the _root.x value is other than 0, the map seems to shrink in a little.

_root.Map is the map as a whole, which contains a mask, a line, and two other movieclips, one also called Map and one called player. _root.Map.Map is what actually has the rooms and dynamic content in it. I've scaled this so that it appears to be the same size as it was previously. The x and y co-ordinates of the _root.Map.Map are set to be in the middle of _root.Map in the second last two lines, and that is the only time where i can see _root.x and _root.y mentioned, and even if i comment those lines out it still changes the overall size.

I can't see why this'd happen. I can post a .fla too if people want to have a look.

Movieclip Onrollover Issue
I created a flash piece for a menu based videos...I created the menu with movieclips.Here the problem comes. When I click on it, I want it to act as a button, So, I did some tricks. by using toggle. Please see the flash swf for following explanation...Since I am duplicating the movie clips, when I click on it, It stays onRelease event, Even though the other button has been clicked...how to trigger it...


http://www.geocities.com/tjsubha/index.html

Thanks in advance

MovieClip.getNextHighestDepth Issue
I've got MCs in the library that I am attaching at runtime onRelease of a button. There are several buttons and that many clips to be attached. The clips attach fine but the "2nd' clip deletes the first clip and I want the "2nd" clip to attach on top of the first. (fade in over the first).

Thanks in advance!







Attach Code

this.createEmptyMovieClip("container",1);
container._y = 106;

MBenzThumbs.MBenzJpgs.btn1.onRelease = function() {
container.attachMovie("c300","c300",container.getNextHighestDepth());
}

MBenzThumbs.MBenzJpgs.btn2.onRelease = function() {
container.attachMovie("cl550","cl550",container.getNextHighestDepth());
}

Masking/movieclip Issue
Issue: I have a image that is masked to only reveal square piece of the image. This image in turn is within a movieclip. the image that I am masking cannot be sliced. The movieclip that the image is in is part of a hitTest action. What is happening is the whole image within the movieclip is being detected with the hitTest of the movieclip. Is there a way to have only the masked square area of the image withing the movieclip be the hitarea instead of the whole image being part of the hitarea?

MovieClip Navigation Issue
Greetings All! All comments welcome in resolving this issue. I wish I could post the swf, however, it is a project for work so I will try and explain as best as possible.

I'm working on an online demo. My intro swf has 3 frames that contain movie clips each movieclip in their own seperate layer (layers 1, 3, 5).

Now layers 2 and 4 are my "Next" buttons.

Here's the problem: when I click the "Next" button to play the next movieclip (in frame 2), the navigation continues to the next frame (frame 2), but does not stop. It goes through all 5 frames of the main swf. So basically you get a quick view of the correct movieclip, but instead of playing the movieclip in frame 2, it flashes frame 2, then the movie clip in frame 3, and so on.

I've used the gotoandStop code, but it doesn't stop. Oh and forget about clicking the "Back" button. The whole thing just goes berzerk! haha

Please, any assistance would be greatly appreciated! If you require more clarification please refer to the online banking demo of Bank of America. I am trying to replicate their navigation with "Next", "Back", and "Pause" buttons.

I'm trying to keep this as one swf file with several scenes. This way, I will only need one preloader instead of several preloaders with the loading of every external swf file.

Thank you all in advance!
n3wbi3

Movieclip Onrollover Issue
I created a flash piece for a menu based videos...I created the menu with movieclips.Here the problem comes. When I click on it, I want it to act as a button, So, I did some tricks. by using toggle. Please see the flash swf for following explanation...Since I am duplicating the movie clips, when I click on it, It stays onRelease event, Even though the other button has been clicked...how to trigger it...


http://www.geocities.com/tjsubha/index.html

Thanks in advance

Movieclip Rollout Issue...
im sure its been post here before(or somewhere). I'm making my movieclip rollovers and everything works just fine, BUT if you rollout TOO FAST the clip stays and flash doesn't recognize the rollout/over...

how is this solved?

Strange Movieclip Issue
Im not sure if this is a noted issue issue or not but Ive got some strange behaviour going on and I could do with some guidance on a way around it.

My game consists of a grid of movieclips, created dynamically. within these movieclips is another movieclip of an explosion.

The explosion movieclip stops at the first frame (blank frame), and the animation starts at from lable "on", once it gets to the end, it jumps to "off" - the first frame.

Now, if I gotoAndPlay("on"); it works, if I gotoAndStop("off"); it works.

However if I gotoAndPlay("on") before the animation has ended (ie: when I want the animation to restart), it carries on regardless and then loops for a few frames before stopping.

If I call stop() before the gotoAndPlay call its the same, but if I call gotoAndStop("off") right before I call gotoAndPlay("on") the animation will loop constantly and no more actionscript on that movie clip will be executed (until another call to gotoAndStop("off"); )

Does anyone have any idea how to fix this?

: D

Variable/Movieclip Issue...
Hey dudes.. just wondering if anyone can shed a bit of light on this for me...

basically i am tryin to move logos around on screen using actionscript..i have lots of them that i want to run through so i'm using variables.. i have an array called logos[0] that the images are coming from and i have MovieClip 6 holders on the stage called holder1 - 6...i've adapted this bit of code i got off a forum to get this workin...


var boxcounter:Number = new Number(1);
var currentlogo:String =new String ("holder"+boxcounter);


var startX = 646;
var endX = 65;
var speed = 10;
currentlogo._x = startX;
function moveMe(targ){
targ._x+=(_root.endX-targ._x)/_root.speed
}
onEnterFrame = function(){
setInterval(moveMe,30,_root.currentlogo)
}


i think i know what the problem is but i just don't know how to fix it... the error is showing in this line
currentlogo._x = startX;
where it says

There is no property with the name '_x'.
currentlogo._x = startX;

what i think is happening is that currentlogo isn't a movieClip its a variable so it doesn't have the property x.. am i right in thinking this?? i've traced currentlogo and i get holder1 which is the name of the movie clip i'm tryin to target.. if i put holder1 into
currentlogo._x = startX; like this..

holder1._x=startX;
it works fine...


is there a different syntax i've to use or something? anyone know? any help would be greatly appreciated!

thanks a mill

leapin

Timeline Movieclip Issue
So i have a animation on a timeline, and a movie in a movieclip.

What i want to happen is the animation plays on the timeline, then when you click the play button to the movie, the movie plays and the timeline stops where its at and pauses.. then when you pause or stop the movie, the timeline starts from where it left off. if there are any ways to go about this.. maybe having both of them on the timeline or something.. im up for it.. any help would be appreciated.

thanks

http://www.anthonybruno.info/kirupa/index_video.fla

Linkage Movieclip Issue
Hi all,

I have one movieclip in (my.fla) and I'm trying to use the linkage to give a classname of "bgMC" to it. Unlike as2, there's no more identifier.

The compiler gives me that error:
Error #1009: Cannot access a property or method of a null object reference.

while running debug in flash cs3, it stops at line:
this.backgroundMC.width = stage.stageWidth;

It can't recognize the linkage that I have declared.
Does anyone know how to fix that?

The idea here is basically I want to reuse this class that I've made on others projects.


my main class:

Code:
package src
{
import manageBG.bgFullScreen;

private var bgScreen:bgFullScreen;
private var test:MovieClip = new bgMC();

public class main extends Sprite
{
public function main():void
{
this.bgScreen = new bgFullScreen(test);
}
}

}
bgFullScreen class:


Code:
package manageBG
{
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.display.MovieClip;


public class bgFullScreen extends Sprite
{
private var backgroundMC:MovieClip;

public function bgFullScreen(mc:MovieClip)
{
this.backgroundMC = new MovieClip();
this.backgroundMC = mc;

this.positionBG();
this.initStage();
}

private function initStage():void
{
stage.addEventListener(Event.RESIZE, handleBG);
}

private function handleBG(evt:Event):void
{
this.positionBG();
}

private function positionBG():void
{
this.backgroundMC.x = 0;
this.backgroundMC.y = 0;
this.backgroundMC.width = stage.stageWidth;
this.backgroundMC.height = stage.stageHeight;

addChild(backgroundMC);
}

}
}

CHILD MOVIECLIP ISSUE Pls Help
Hi All

Need urgent help! Thx very much in advance.

Issue/Q.: Is there a way to reset a Child MC so that it loads as it was the first time?

I have a MC (Main) which has various buttons(of movieclip type). Each of these buttons will load a Child MC using addChild(). The Child MC contains various slides which i flip thru using its own buttons (movieclip type).Working fine when loading and unloading these Child Mc's in the Main MC using addChild and removeChild.

PROBLEM SCENARIO:

Clicked button 1 on Main MC to load child 1 using addchild.
Flipped thru the slides on this child1.
clicked on button 2 on the Main MC- loads child 2 (working fine)

But if i go back and click button1 to re-load the child1, child1 loads fine but displays the last slide that i viewed in it. This is happening bcos the AS in the Child MC is doing its job by displaying the slides.

But, is there any way to reset the child MC. I thought that when i am unloading the Child MC and then reloading it, it would start afresh! Pls pls advise....

Thanks again for any of ur advice/help. really appreciate any insight into this issue....

Masking/movieclip Issue
Issue: I have a image that is masked to only reveal square piece of the image. This image in turn is within a movieclip. the image that I am masking cannot be sliced. The movieclip that the image is in is part of a hitTest action. What is happening is the whole image within the movieclip is being detected with the hitTest of the movieclip. Is there a way to have only the masked square area of the image withing the movieclip be the hitarea instead of the whole image being part of the hitarea?

MovieClip Navigation Issue
Greetings All! All comments welcome in resolving this issue. I wish I could post the swf, however, it is a project for work so I will try and explain as best as possible.

I'm working on an online demo. My intro swf has 3 frames that contain movie clips each movieclip in their own seperate layer (layers 1, 3, 5).

Now layers 2 and 4 are my "Next" buttons.

Here's the problem: when I click the "Next" button to play the next movieclip (in frame 2), the navigation continues to the next frame (frame 2), but does not stop. It goes through all 5 frames of the main swf. So basically you get a quick view of the correct movieclip, but instead of playing the movieclip in frame 2, it flashes frame 2, then the movie clip in frame 3, and so on.

I've used the gotoandStop code, but it doesn't stop. Oh and forget about clicking the "Back" button. The whole thing just goes berzerk! haha

Please, any assistance would be greatly appreciated! If you require more clarification please refer to the online banking demo of Bank of America. I am trying to replicate their navigation with "Next", "Back", and "Pause" buttons.

I'm trying to keep this as one swf file with several scenes. This way, I will only need one preloader instead of several preloaders with the loading of every external swf file.

Thank you all in advance!
n3wbi3

Linkage Movieclip Issue
I have one movieclip in (my.fla) and I'm trying to use the linkage to give a classname of "bgMC" to it.
Unlike as2, there's no more identifier.

The compiler gives me that error:
Error #1009: Cannot access a property or method of a null object reference.

while running debug in flash cs3, it stops at line:
this.backgroundMC.width = stage.stageWidth;

Does anyone know how to fix that?


So, my main.as looks like:
Code:

package src
{
import manageBG.bgFullScreen;

private var bgScreen:bgFullScreen;
private var test:MovieClip = new bgMC();

public class main extends Sprite
{
  public function main():void
  {
   this.bgScreen = new bgFullScreen(test);
  }
}

}


I have another class to manage my background:
Code:

package manageBG
{
   import flash.display.Sprite;
   import flash.display.Stage;
   import flash.events.Event;
   import flash.display.MovieClip;
   

   public class bgFullScreen extends Sprite
   {
      private var backgroundMC:MovieClip;
      
      public function bgFullScreen(mc:MovieClip)
      {
         this.backgroundMC = new MovieClip();
         this.backgroundMC = mc;
         
         this.positionBG();
         this.initStage();
      }
      
      private function initStage():void
      {
         stage.addEventListener(Event.RESIZE, handleBG);
      }
      
      private function handleBG(evt:Event):void
      {
         this.positionBG();
      }
      
      private function positionBG():void
      {
         this.backgroundMC.x = 0;
         this.backgroundMC.y = 0;
         this.backgroundMC.width = stage.stageWidth;
         this.backgroundMC.height = stage.stageHeight;
         
         addChild(backgroundMC);
      }
      
   }
}

Issue With AS & MovieClip Buttons
button1.onRollOver = over;
button1.onRollOut = out;
button1.onRelease = function(){
gotoAndPlay("portfolio");
}

button2.onRollOver = over;
button2.onRollOut = out;
button2.onRelease = function(){
gotoAndPlay("portfolio");
}


function over() {
this.gotoAndPlay("_over");
}
function out() {
this.gotoAndPlay("_out");
}


This above code is what I'm currently using to control my buttons.
button1 & button2 being the instance names of two buttons. "_over" & "_out" being the labels within those movieclips that activates the over and out states of my buttons. "portfolio" is a label on my maintime that i'm choosing to call. ( yes i know i have it listed for both, but that shouldn't matter since it would just call the same thing on each button )
my button1 is working fine, no flaws what so ever, but button2 is not doing anything. It's not even showing as a button when I test my movie. I did the same technique as I did in the first. ( i've checked over it like 20 times now ) Also, I noticed if I put my actions for these buttons in a certain keyframe it won't work, shouldn't it work no matter where I put it on the timeline? :cry:

Movieclip Depths Issue
Hi all..

I think you should have all the info needed to help me here...
If not.. let me know...

Basically, I am having trouble with movie depths in this script.
I want to able to load a movie in using the variable imgLoc2 which works fine...
(i know this because if i remove the lines:

Code:

tester1._x = origin[myName]._x;
tester1._y = origin[myName]._y;


I can see the movie successfully load...)

However, if those lines are there, the movie becomes masked under the blank tile, or the loaded tile current frame... (which only contains a holderclip for the tile tool, and a graphic of the number for the tile tool(which tool) )
...so i can't see it...

What do i need to do to fix this?


Code:

// ***************************************************************************
// ** Grid Drawing Functions **
// ***************************************************************************

// Simple function to ensure a consistent object naming structure
function tileName(x,y) { return "tile" + x + "_" + y; }

// Draw the blank tile board
function drawGridFoundation() {

// Initialize stacking depth for tiles
var tileDepth = 1000;

// Iterate through the rows
for (var gH:Number = 0; gH < level.gridHeight; ++gH) {

// Iterate through the columns
for (var gW:Number = 0; gW < level.gridWidth; ++gW) {

// Set name of the tile
var myName:String = tileName(gW,gH);

// Add tile movie clip (from library) to the display
origin.attachMovie("tile", myName, tileDepth);
origin[myName]._x = gW * level.tileSize;
origin[myName]._y = gH * level.tileSize;
// Set response for clicks on the tile; see function later
origin[myName].onMouseDown = function() { _root.updateTile(this);
tester1._x = origin[myName]._x;
tester1._y = origin[myName]._y;
tester1.loadMovie(imgLoc2);
};

// Increase tile depth for next time around
tileDepth++;
}
}
}



here is the function for updatetile:

Code:

// Change a tile to the current tool shape when clicked
function updateTile(who) {

// if it is NOT the player tool, then toggle on/off
if (_root.tool.current != 7) {

// only update the tile if this one was clicked on
if (who.hitTest( _root._xmouse, _root._ymouse, false)) {

// if this tile is not already set to the current, then set it
if (who._currentframe != _root.tool.current) who.gotoAndStop(_root.tool.current);

// if it is already set to the current, clear it
else who.gotoAndStop(1);
}

// but if it IS the player tool, then only allow one
} else {

// if it's this one
if (who.hitTest( _root._xmouse, _root._ymouse, false)) {

// if this tile is not player, and player has not be placed, place it here
if ((who._currentframe != _root.tool.current) && (!_root.tool.playerPlaced)) {
who.gotoAndStop(_root.tool.current);
_root.tool.playerPlaced = true;

// but if this tile is player, unplace it
} else if (who._currentframe == _root.tool.current) {
who.gotoAndStop(1);
_root.tool.playerPlaced = false;
}

}
}
}




- thanks
karmakat aka aleksandr berland

Nested MovieClip Issue
Code:

for(countCheck=0;countCheck<_root.carCount;countCheck++){

if(this._x+(this._width/2)>_root["Car"+countCheck]._x && this._x-(this._width/2)<_root["Car"+countCheck]._x &&
this._y+(this._height/2)>_root["Car"+countCheck]._y && this._y-(this._height/2)<_root["Car"+countCheck]._y){
_root["Car"+countCheck]._y=_root["Car"+countCheck].prevCarY;
_root["Car"+countCheck]._x=_root["Car"+countCheck].prevCarX;


}
}



okay, i have the above code inside a movieClip:
The movieClip acts as a wall in a game that if any car hits the wall, the car will stop.

This code works fine if i place this symbol on the _root directory

however if i place this inside another movieClip it no longer works!!!

can anybody tell me why?



thanks

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