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








[F8] OnRollover Play Attached Movie Clip?


I'm trying to attach a movie clip and to play that movie clip on rollover. At this point the movie is being attached, but the rollover/rollout functions don't work!

What am I missing here? See code below.
Thanks in advance!

PHP Code:




onEnterFrame = function () {
    _root.attachMovie("menu","menu_mc",1, {_x:0,_y:200})
    menu_mc.onRollOver = function () {
        this.play();
        delete menu_mc.onEnterFrame;
    }
    menu_mc.onRollOut = function () {
        this.onEnterFrame = function() {
        menu_mc.prevFrame();
    }
    }
}




FlashKit > Flash Help > Flash ActionScript
Posted on: 09-03-2007, 01:07 AM


View Complete Forum Thread with Replies

Sponsored Links:

Sounds Won't Play In Attached Movie Clip
I have a MC that is being attached at the beginning of my movie and then removes itself when its done playing. When im editing intro.fla, and ctrl+enter it works and I can hear the sounds...Now when I open movie.fla the sounds in my attached movie dont play. The intro animation still works just no sound. The sound in my main movie even works. I check all my publish setting and made sure the sound settings are the same on both movies.

Audio Stream: MP3, 80 kbps, Mono
Audio Event: MP3, 80 kbps, Mono

View Replies !    View Related
Play TWO Seperate Movie Clips OnRollover
Hey everyone,

I've struck a little problem here. I'd really like to make the 'moving_image_mc' play at the same time as the tabs are moused over.

I'm not sure of how to change the actionscript to make it work.

Any help would be great thank you

R

View Replies !    View Related
Actionscript: Change OnRollover From Play Movie To Go To Link
I can't remember how to do this anymore, I have a flash menu which was originally configured to play a new flash movie (i think) upon rollover or click of the flash menu buttons

i want to change this to go to a htm or php link instead.. what do i change in this actionscript??:


Code:
onClipEvent(load) {
num=4;
this.title.gotoAndStop(num);
}

on(rollOver) {
if(_root.link<>num) {
this.gotoAndPlay("s1");
this.sign.gotoAndPlay("s1");
_root.menu2["item" + num].gotoAndPlay("s1");
}
}

on(rollOut, releaseOutside) {
if(_root.link<>num) {
this.gotoAndPlay((_totalframes-55) - _currentframe);
this.sign.gotoAndPlay("s2");
_root.menu2["item" + num].gotoAndPlay("s2");
}
}


on(release) {
if(_root.link<>num and _root.animation==1) {
_root.animation=0;
this.gotoAndPlay("s3");
_root.link_prev=_root.link;
_parent["item" + _root.link].gotoAndPlay("s4");
_parent["item" + _root.link].sign.gotoAndPlay("s2");
_root.menu2["item" + _root.link].gotoAndPlay("s2");
_root.link=num;
_root.play();
}
}

if this doesnt look like gobbldeygook to anyone could they point out the section where i can add my link? i don't mind playing with it but i dont know where to start!

View Replies !    View Related
Movie Clip OnRollOver
Movie clip onRollOver

The code below displays a number of horizontal bars with a green box in each.

When the mouse rolls over a bar, the myrollover function is activated.

How do i get it to activate that function ONLY when the mouse rolls over a green box?

Code:
this.display_mc.list_mc[name1].name2.onRollOver = myrollover;
won't work.

Thanks.


Code:
function buildList() {
var spacing:Number = 30;

for (var i = 0; i < list.length; ++i) {
var name1:String = "infoBar" + i + "_mc";
var name2:String = "greenbox" + i;

var y1:Number = i * spacing;

display_mc.list_mc.attachMovie("infoBar", name1, i);
display_mc.list_mc[name1].attachMovie("greenbox", name2, this.getNextHighestDepth(), {_x:230});

display_mc.list_mc[name1]._y = y1;
display_mc.list_mc[name1].theTitle_txt.text = list[i];

this.display_mc.list_mc[name1].onRollOver = myrollover;

}
}

View Replies !    View Related
Audio Won't Play When Attached In A Loaded Movie
I am using the sound object to start a sound in a swf file (call it movie1). When I play the swf by itself, the sound plays fine. When I load the swf (movie1) into a placeholder movieclip in another swf (movie2), the sound doesn't play. I assume my sound object code is correct since it plays when movie1 is viewed by itself.

Is there something I am missing?

Thanks for any help.

View Replies !    View Related
How To Pause A Movie Clip OnRollOver?
I have a movie clip that crossfades through 5 images (looping).

I want 2 things to happen and I'm not getting very far with them:

1) I want the animation to pause onRollOver (so that the movie clip won't crossfade while the mouse is over it). I can't seem to get the movie clip to pause (though I can make the main timeline stop() and play(), which is not what I'm going for). I know I must be close, but I'm probably putting my code in the wrong place.

2) If the user clicks on the clip I would like the timeline to skip to one of five places, depending on which image was showing when the movie clip was clicked. I'm trying to get some code together that will evaluate what frame the movie clip is on when it is clicked, and skip the timeline around accordingly...

Any help is appreciated. I'm pretty new to AS (obviously!) so speak slowly

View Replies !    View Related
OnRollOver Event With Movie Clip
I'm trying to get cerrtain events to happen when I roll over a certain movie clip, for some reason this won't do anything. Can anyone tell me what I'm doing wrong?


Code:
mAbout.onRollOver = function(){
mItemOne.htmlText = "<a href='http://www.ninercaphell.com'>Test</a>";
mHome.rewind();
};

View Replies !    View Related
Onrollover With Dynamic Movie Clip
hi

i have a movie clip that is a small dot, when i rollover it the button inside of it creates a dynamic pop up from and external .swf file,

on rollout it closes

my problem is i cant get the pop up to stay open so i can click on it to get url for a web site

an then close if i dont want to click on it

on (rollOver) {
this.swapDepths(this._y);
createEmptyMovieClip("Holder",-1);
Holder.loadMovie("FROM_Pod_1.swf");
Holder._x = -155;
Holder._y = -125;
}
on (release){
getURL ("website")
}
on (rollOut) {
prevFrame();
}

this is attch to the button


i know this has to to be simple

thank you for your help

View Replies !    View Related
Onrollover Movie Clip Question
I have a question? How do you have the effect when you rollover a movie clip without getting the onrollover button effect.

View Replies !    View Related
OnRollOver Not Obeying Movie Clip Depth
Hello. I have a movie clip which has an onRollover action applied to it (when rolled over, something happens). I have created another movie clip which hides half of the one with the onRollover action. My problem is that the onRollover action is still being executed, even when the mouse rolls over the half of the movie clip that is being hidden

I have set the depth of the two movie clips correctly. The movie clip that hides half of my other movie clip is at a higher depth. To be sure it wasn't me, I even tried switching their depths, but the same problem occurs.

If anyone has any ideas I would greatly appreciate it.

Thanks!

View Replies !    View Related
[F8] OnRollOver Close Previous Movie Clip ?
Hey everyone,

I'm using movie clips as buttons to call out other movie clips. When you roll over it plays and stays up until you manually close it with a button or roll off of the called out clip itself. If you never roll over the called out clip in the first place and roll over another movie clip btn, it leaves the previous movie clip up and brings up the new one over the top of it. Is there any piece of actionscipt that I can use that will close the last movie clip opened by rolling over a new movie clip btn?

Or is there a better way to achieve the same goal?

Thanks!

View Replies !    View Related
Movie Clip OnRollover Treating MC Like Button
Hi,

I have a movie clip who's alpha value is to be changed when the mouse is placed over the movie clip's area.

I am using the following code:


ActionScript Code:
custlogin1.onRollOver = function() {
    custlogin1._alpha = 100;
}

When I run the SWF and hover the mouse over the clip, it briefly sets the alpha to 100 (<1ms) and displays the hand cursor; then sets the alpha back to its original value of 30.

My question is: Am I doing this right? It seems as though my code is turning my MovieClip into a Button. Is there a different way to do MouseOvers with MovieClips?

Thanks in advance,
-John

View Replies !    View Related
Return Movie Clip Instance Name OnRollOver
Hi All,

Sorry if this is a stupid questions but I am relatively new to actionscript.
I have a movie clip on the main timeline that contains a large number of clips that I am storing different pieces of information against.
I want to dynamically return the movie clip instance names of the clips in the container with a rollover function so I can pass the instance name into custom class.
I am wanting to use a function that will treat the returned instance name as a variable that I can pass into the custom class as to avoid having to code the class function against each individual movie clip.

Is this possible as I have been searching for ages and have not found anything that accomplishes this.

Many thanks in advance

View Replies !    View Related
OnRollOver Not Obeying Movie Clip Depth
Hello. I have a movie clip which has an onRollover action applied to it (when rolled over, something happens). I have created another movie clip which hides half of the one with the onRollover action. My problem is that the onRollover action is still being executed, even when the mouse rolls over the half of the movie clip that is being hidden

I have set the depth of the two movie clips correctly. The movie clip that hides half of my other movie clip is at a higher depth. To be sure it wasn't me, I even tried switching their depths, but the same problem occurs.

If anyone has any ideas I would greatly appreciate it.

Thanks!

View Replies !    View Related
Asign OnRollOver Function To Movie Clip
is there any vay to assign functions to MCs after I load externel jpg
into them?
This is what I mean.

var mclListener:Object = new Object();
var thb_mcl = new MovieClipLoader();
function ld_mov1() {
for (i=1; i<=16; i++) {
thb_mcl.loadClip("./paintings/"+i+".jpg", "thb"+i+"_mc");
eval("thb"+i+"_mc").onRollOver = function(){
trace(something)
}
}
}

well, this works fine before I load the JPGs.
is there any solution for this?

View Replies !    View Related
Buttons Inside A Movie Clip With OnRollover On The Mc
Hey guys, I'm trying to do a menu as I mentioned in this thread: http://www.kirupa.com/forum/showthread.php?t=252211

I have the menu working, animating, how I'd like. But when I've put the buttons on it, inside the movie clip, they don't work, I'm guessing because onrollover is defined on the mc they are in! I'm sure there's an easy work around for this but please can someone tell me what it is! Thanks...

HPD

edit- i have attached the FLA. thanks

View Replies !    View Related
[FCS3] OnRollover Movie Clip Triggers Only Once
Hello,
I am getting an unexpected behaviour when using the onRollOver event with a movieclip.
The onRollOver behaviour is initialised after some animation. This allows me to hold my cursor over the movieclip. When the initialise function adds the onRollOver event function to the clip, it triggers, even though my cursor is already over the clip and a nice animated glow is added to the movieclip. This is good and the behaviour I want.

onRelease the movieclip I call a disable function and this sets the onRollOver event function to null. After some more devestatingly good animation, I reuse the initialise function to reset the onRollOver event function to react again. This time, if my cursor is already over the clip when the onRollOver is initialised, the onRollOver does not fire.

I'm guessing this has something to do with a function already being attributed to the onRollOver behaviour but I have reached (oh so quickly) the limit of my AS knowledge. Can someone please tell me why this is happening and if there is anything I can do about it?

Hopefull this code snippet is clearer than that description:


Code:

function wsInitNodes():Void{
wsCurrentNode.onRollOver = function(){
// Do groovy animation stuff
};
wsCurrentNode.onRelease = function(){
wsDisableNodes();
};
}

function wsDisableNodes():Void{
wsCurrentNode.onRollOver = null;
wsCurrentNode.onRelease = null;
}

// animation
// cursor over clip
// wsInitNodes();
// onRollOver fires
// wsDisableNodes();
// Do some other stuff
// cursor over clip
// wsInitNodes();
// onRollOver does not fire
// Stuck, any help would be great, thanks.

View Replies !    View Related
Can The OnRollOver Function Register As Soon As I Roll Over The Movie Clip?
I have some simple ActionScript going where it creates an empty movie clip and adds some dynamic text as well as attaching a movie called thistle to via the library.

The problem I am having is since the thistle movie clip in the library is not fully square the mouse can only click on it when it hovers over the graphics exactly. I would prefer that it just used the boundary of the movie clip rather than the outer edges of the graphic.

Is there anyway in ActionScript that would allow me to have the onRollOver function register as soon as I roll over the attached movie clip rather than when it actually meats some from of drawn line inside the movie clip.

Here is my code that creates the empty movie clip and adds in a text field and a movie clip called thistle:

ActionScript Code:
for (var i:String in menuArray) {
    txt = "txt_"+i; mc_txt= "mc_txt_"+i; thistle_mc = "thistle_mc"+i;
   
    this.createEmptyMovieClip(mc_txt, this.getNextHighestDepth());
   
    this[mc_txt].attachMovie("thistle", thistle_mc, 2, {_x:startMenuX, _y:startMenuY+10});
    var trans:Transform = new Transform(eval(mc_txt+"."+thistle_mc));
    trans.colorTransform = new ColorTransform(0, 0, 0, 0,   0, 0, 0,  100);

    this[mc_txt].createTextField(txt, 1, startMenuX+20, startMenuY, 150, textHeight);
    eval(mc_txt+"."+txt).text = menuArray[i];
    var my_fnt:TextFormat = new TextFormat();
    my_fnt.font = "Rage Italic";
    my_fnt.bold = true;
    my_fnt.size = 22;
    eval(mc_txt+"."+txt).setTextFormat(my_fnt);
    startMenuY+=textHeight;
    this[mc_txt].onRollOver  = clickHandler;    
}

Thanks

View Replies !    View Related
Targeting Child Movie Clip OnRollOver Issues
I'm been writing AS for a while so I'm totally stumped on this one. How do you target the child clip of a movie for a rollOver action? Here is the code I am using - pretty straight forward. I have one clip called main_mc that has two clips within it: mc1 and mc2. I can set the alpha property with this targeting, but not the rollover. Nothing gets traced to the output window on rollover of child movieclips. What's going on?

main_mc.onRollOver = function(){
trace("main mc rolled over");
for (i=1; i<3; i++){
this["mc" + i].onRollOver = function(){
trace("mc1 or mc2 rolled over");
}
this["mc" + i]._alpha = 50;
}
}

View Replies !    View Related
Movie Clip ? - Attached
i am having difficulties with the following: if you click on the contact. button - the gray bar (Movie clip1) will play once and the orange (movie clip2). after that i would like it to go to the same page with all of that static and it to say 'contact'. (contact should not show before the movieclips play.) i tried various actions, but nothing seems to work. i have attached the file. i am just learning actionscripting, any help will be very much appreciated! thank you!

View Replies !    View Related
Movie Clip OnRollOver Function Call? Newbie Question
I'm having an issue with a simple movieclip onRollOver event. Here's my code:


Code:
_root.mc_shutternav.mc_nav_8.onRollOver = over;
_root.mc_shutternav.mc_nav_8.onRollOut = out;
_root.mc_shutternav.mc_nav_8.onRelease = hit;

// definition for over state
function over()
{
this.gotoAndPlay(2);
}

// definition for out state
function out()
{
this.gotoAndPlay(6);
}

function hit()
{
_root.gotoAndPlay(2,1); // play scene 2
}
So all I'm trying to do is call one function to control my movie clip onRollOver actions, however I'd like to be able to pass variables to the "hit" function so something like this:


Code:
_root.mc_shutterright.mc_nav_8.onRelease = hit(variable);

function hit(variable)
{
_global.urljumpto = variable;
trace(urljumpto);
_root.gotoAndPlay(2,1); // play scene 2
}
However, with this setup the function hit() is called automatically every time I publish the movie. What's wrong with this? What's the difference between mc.onRelease = function; and mc.onRelease = function()? thanks!!!

ps, sorry, I'm publishing in AS 2.0 and flash player 9

View Replies !    View Related
OnRollOver, OnRollOut Not Working On All Attached Clips...
i'm trying to make this little news section and for some reason the rollover and rollout works only on the last news itemClip to be attached. you can take a look at it HERE and see that the bottom one is the only one working.

can anyone tell me why and what i might have done wrong in the actionscript?

thanks for the help.


Code:

//-----------------------------------------------------------
Stage.scaleMode = "noScale";
newsXML = new XML();
newsXML.ignoreWhite = true;
//-----------------------------------------------------------
newsXML.onLoad = function(success){
if(success){
trace("success!!!");
var root = this;
var cNodes = root.firstChild.childNodes;
trace(cNodes);
_global.firstNewsItem = cNodes[0];
for (var i = 0; i < cNodes.length; i++){
item = itemHolder.attachMovie("itemClip", "itemClip" + i, i);
trace(item);
itemHolder.setMask(itemMask);
item._x = 0;
item._y = 23 * i;

item.myT.text = cNodes[i].attributes.name.toString();
item.itemDate.text = cNodes[i].attributes.date.toString();

item.myTitle = cNodes[i].attributes.name.toString();
item.myDetails = cNodes[i].attributes.details.toString();
item.myImg = cNodes[i].attributes.img;
}
item.onRollOver = function(){
this.itemM.gotoAndPlay("over");
}
item.onRollOut = function(){
this.itemM.gotoAndPlay("out");
}
item.onRelease = function(){
var aItem = this;
imgHolder.loadMovie(aItem.myImg);
myTitle = aItem.myTitle;
myDetails = aItem.myDetails;
}
}
}

newsXML.load("news_xml/newsList.xml");

View Replies !    View Related
Checking To See If A Movie Clip Has Been Attached
Hey all, got a problem thats been bugging me. Let's say I have a MC named square that has a motion tween (like in a slider). We have another MC named circle and a button. When the button is pressed I used attachMovieClip() to attach the circle to the square, so now the circle follows the same motion as the square.

The problem lies on the loop. When the square hits its last frame it has a gotoAndPlay (1); action on it to loop the animation. When that happens the circle no longer appears on the square, you have to hit the button again.

How would I check to see if the square has a movie clip attached to it and if it does the movie clip that is attached stays on it until a further action tells it to be removed? Or is there something I need to place withing the "circle" MC to make it continue?

Thanks in advance,
-DigitaL FusioN

View Replies !    View Related
Remove An Attached Movie Clip
ok,
my problem is i can't remove a previously attach movie clip.
my movie/script is something like this,:
two movieClip in the library-
"onStage" and
"target"
linkage for "target"=target
four "onStage" on the stage
each "onStage" with this script:

//--------------------------------
onClipEvent (mouseMove) {
if (hitTest(_root._xmouse, _root._ymouse, flase)) {
removeMovieClip("target1");
attachMovie("target", "target1", 1 );
}
}
//--------------------------------

it won't work.
i want to make something like highlighting effect.
the movieClip "target"(is a green frame something like this[]) will appear everytime my mouse cursor is on the "onStage"(a blank box movie clip) but it will be remove when my mouse cursor is on another "onStage" movie clip and appear again on this "onStage"(where my cursor is)movie clip.
cursor = ([])
mc = (.)

. .[.].
[.]. . .
.[.]. .
. . .[.]

does my script have any problem?
any suggestion? i don't want to use any button on my movie.
what does the attachMovie(idName, newName, depth) DEPTH means?

View Replies !    View Related
Interacting With An Attached Movie Clip?
Hey,

I have four mcs on the stage, each with a button inside. Also on the stage I have a blank movie clip. When I click one button it attaches another mc called content to the blank movie on the stage. A first part of an animation in the content mc then plays and stops.. so far all good.

However I want to be able to click a button (the same button that I used to attach the movie clip) to tell content mc to play the rest of its animation and then stop.

I have used this code on the button to make the animation play, but it doesnt work:

on (release) {
with("att1"){
gotoAndPlay(move);
}
}

att1 is the linkage name of my content mc.
I cant seem to interact with the new movieclip I have attach to the stage. Does anyone have any suggestions of how I can do this? I am using Flash MX. I have attached my fla, so its easier to understand.

Thanks

View Replies !    View Related
Interacting With An Attached Movie Clip?
have four mcs on the stage, each with a button inside. Also on the stage I have a blank movie clip. When I click one button it attaches another mc called content to the blank movie on the stage. A first part of an animation in the content mc then plays and stops.. so far all good.

However I want to be able to click a button (the same button that I used to attach the movie clip) to tell content mc to play the rest of its animation and then stop.

I have used this code on the button to make the animation play, but it doesnt work:

on (release) {
with("att1"){
gotoAndPlay(move);
}
}

att1 is the linkage name of my content mc.
I cant seem to interact with the new movieclip I have attach to the stage. Does anyone have any suggestions of how I can do this? I am using Flash MX. I have attached my fla, so its easier to understand.

Help!

View Replies !    View Related
Attached Movie Clip Event?
is it possible to attach a clip event to an attached movie???

if i just click and drag an item to the stage i can give it properies like this...

code:
onClipEvent (enterFrame) {
//x movement
if (_root._xmouse<=455 && _root._xmouse>=30 && _root._ymouse<=592 && _root._ymouse>=98) {
mx = _root._xmouse;
if (mx<_x) {
dx = _x-mx;
} else {
dx = mx-_x;
}
moveSpeedx = dx/1;
if (mx<_x) {
_x = _x-moveSpeedx;
} else {
_x = _x+moveSpeedx;
}
}
}



but what if i am attaching a movie...

Thanks,
Carlos

View Replies !    View Related
How Do I Add An OnClipEvent To An Attached Movie Clip?
How do I add an onClipEvent () to an attached movie clip or an movie clip created with the createEmptyMovieClip() function?

View Replies !    View Related
[F8] Accessing A Movie Clip Thats Been Attached
Hello...

So I need some help. I have a photo gallery menu. It has 4 options. Each option contains a different amount of photos. I have a dynamic text box that shows the number of photos for that menu option and buttons that are SUPPOSED to advance the photos. I've grouped all these (the text field and buttons) into one movie clip. I want that movie clip to attach itself to each menu option upon the menu option being clicked. It attaches fine. The number of photos for the menu display correctly but the buttons (which are really movieclips with a _btn extension) don't work! I could really use a fresh pair of eyes. I am inserting what I have for this.

I've labled the linkage of the movieclip properly, as "navi." Everything is spelled right, I just don't get it. ...and like i said the dynamic text field is showing properly, so not sure why the same target isn't working for the buttons. Thanks in advance.


pos_txt = the dynamic text field

next_btn = the movieclip thats supposed to advance the gallery

previous_btn = the mc thats supposed to go backward in the gallery





onEnterFrame = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}

photography_mc.nav_mc.previous_btn.onRelease = function() {
prevImage();
}
photography_mc.nav_mc.next_btn.onRelease = function() {
nextImage();
}

function picture_num() {
current_pos = p+1;
photography_mc.nav_mc.pos_txt.text = current_pos+" / "+total;
}

function nextImage() {
if (p<(total-1)) {
p++;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
photo_mc.loadPhoto(image[0]);
desc_txt.text = description[p];
picture_num();
}

View Replies !    View Related
Actions On An Attached Movie Clip?
I having trouble trying to get an action on an attached movie clip. Basically all I want is the attached movie clip to expand on rollover.

I have put the follwing code on the first frame of my movie. The clips are loading fine but they don't seem to be registering the onEnterFrame script

Code is as follows:

for (i=0; i<8; i++){
var attachedClip = _root["thumbnail"+i].attachMovie("thumbnailmovie", "thumbnail"+i, 1000+i);
attachedClip.thumbnailname = mydata.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
attachedClip.itemnumber=i;
attachedClip._x=currentx;
attachedClip._y=currenty;
currentx+=110;
attachedClip.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
elasticScale(100, 0.2, 0.5)
mx.behaviors.DepthControl.bringToFront(this);
} else {
elasticScale(65, 0.1, 0.5)
}
}
}

can anyone suggest what I'm doing wrong?

View Replies !    View Related
[CS3] Constraining An Attached Movie Clip?
Hello,
I am loading a picture into a box, via attachMovie. The size of the image is larger than the box it is being loaded into, so I am trying to constrain it to the size of the object it is being loaded into. Here is what I got.

sight.attachMovie("eye","eye1",sight.getNextHighes tDepth())
eye1._yscale = sight.height
eye1._xscale = sight.width

View Replies !    View Related
Attached Movie Clip Is Gigantic.
Using the code below I set a mc called background to my scrollPane,
then attach a mc called Viewport on top of it (viewport is text)...

Anyways viewport exists with alpha=0 on the stage (so I can get its
dimensions) It starts at 20x20 then when it loads it grows.

Problem is when i attach it on background (after I make bkg the same size and width) the viewport Mc is HUGE!! It looks like its been zoomed to 1000%... Can anyone help me?

THANKS IN ADVANCE !!!

//set scrollpane content...
this.scrolly.setScrollContent("background");
var cnt = this.scrolly.getScrollContent();
var depth = cnt.getDepth();

var sWid = this.viewport._width;
var sHeight = this.viewport._height;
this.cnt._width = sWid;
this.cnt._height = sHeight;
cnt.attachMovie("viewport","viewport",depth + 1);

View Replies !    View Related
Attached Movie Clip & Preloader
There are two attached movie clips loaded on the first frame from the library. These are loaded before my preloader...how can I have my preloader load first and (if possible) include the attached clips in the percentage loaded.
Please post if this is not possible also....thanks a lot.
Memphix

View Replies !    View Related
Duplicating An Attached Movie Clip
Hi all,

I have several movie clips that are dynamically attached to a base Movie Clip (when user clicks on a button). Think of a torso as a base MC; and shirt, jacket, etc. are attached to it using attachMovie method.

After attaching the MCs, I want to be able to duplicate the base MC (the torso) and all the attached MCs. How do I do this? When I use duplicateMoveClip method it only duplicates the base.

Any help would be appreciated. Thank you very much!

Bdik

View Replies !    View Related
Resize Attached Movie Clip
Hi,

I have a movie clip to which I attach several others always at the same depth so one replaces the other. I was trying to change the size of the attached movies by setting the ._width and ._height properties and also by using the xscale without any luck. I finally experimented with a tutorial example and got it to work and saw that the only difference between the code in the example and my own was the depth which I had set to 1 and the tutorial had set to 0. I changed my depth to 0 and it worked.

I didn't see anything specifying that the depth had to be 0 and believe I am still missing something. If anyone cna help me figure out what's going on I would appreciate it.

Thanks


Chris

View Replies !    View Related
Removing Attached Movie Clip.
Hi,

I'm having a lot of trouble removing an attached movie clip. Basically I have set up a function to attach a movie clip name it 'mainNew'+1 then delete the previous clip i.e. mainNew. I have been stuck on this for hours, the code I have is the below, would really appreciate some help on this:


ActionScript Code:
#include "lmc_tween.as"
 
var lev = 0;
 
function removeCurrentClip()    {
//  trace('slideMain ' + slideMain.currentClip);
    removeMovieClip(slideMain.mainOld);
    removeMovieClip(this.slideMain.mainOld);
    this.slideMain.removeMovieClip(mainOld);
 
    trace('mainOld from remove = ' + slideMain.mainOld);
}
 
function mainClip (newClip) {
    lev++;
    slideMain.mainOld = mainNew;
    slideMain.mainNew = 'mainNew'+lev;
    trace('mainOld = ' + slideMain.mainOld);
    trace('mainNew = ' + slideMain.mainNew);
    slideMain.attachMovie([newClip] ,'mainNew'+lev,lev,{_alpha:0}).alphaTo(100,1.5,'linear',.2, removeCurrentClip);
 
}
 
slide1.onRelease = function()   {
    mainClip('one');   
}
 
slide2.onRelease = function()   {
    mainClip('two');
    trace('slideMain.currentClip = slideMain.newClip ' + slideMain.currentClip);
}
 
mainClip ('one');

View Replies !    View Related
Q: Xscale On A Movie Clip With A Loadmovie Attached?
hi. here's my situation. i've loaded a movie onto a movie clip. then i use xscale and yscale on the MC to flip the loaded movie, using code like the following (flipVar equals wither 100 or -100):

_root.myClip._xscale = flipVar;

correct me if i'm wrong: for a regular MC without an swf loaded, this just sets the flip absolutely - if flipVar equals 100, it'll be normal and if it's -100, it'll be flipped... no matter what it was before this operation.
but it seems like with a loaded swf it sets it relative to how it was before the operation - if it was upside-down and flipVar is -100, it'll be right-side-up. is this all correct? if so, how can i flip a loaded movie absolutely?
your help is much appreciated!

View Replies !    View Related
Button In An Attached Movie Clip Won't Work
I have a Movie Clip in my library called "Attachment". On the timeline for Attachment, there's just one frame, with some artwork and a button that goes to Frame 10 of the parent scene.

When I use the attachMovie function, "Attachment" shows up but the button doesn't work. In fact, to be honest, it doesn't seem to respond to my clicks at all, so I'm assuming that the image of the button is there, but the button isn't work.

I should note the buttons on the movie clip are also in my library. Am I jumbling something up? Do I need to do linkage for the buttons in the library, or just linkage for the movie clip since that's what I'm calling?

View Replies !    View Related
Possible To GetProperty Of An Attached Or Duplicated Movie Clip?
I'm trying to do a getProperty to find the _x position of duplicated and attached movie clips, but it's not working. Works fine for other movie clips. Any suggestions?
Thanks
John

View Replies !    View Related
UG How To Add Action Scripts To New Attached Movie Clip?
I start attach a movie clip with:

dep = this.getNextHighestDepth();
attachMovie("mymovie", "newMovie", dep);

In Result, the scene is attached with movie clip "newMovie".


NOW, i wanna add some action scripts over the newMovie with :
onClipEvent (enterFrame) {
if (xx=12) {
xxx = 31;
}
}
onClipEvent (load) {
xxxx = 65;
}
onClipEvent (keyup) {
xxxx = 65;
}

So, how to assign the scripts to the new movie clip?

View Replies !    View Related
UG How To Add Action Scripts Over The New Attached Movie Clip?
I start attach a movie clip with:

dep = this.getNextHighestDepth();
attachMovie("mymovie", "newMovie", dep);

In Result, the scene is attached with movie clip "newMovie".


NOW, i wanna add some action scripts over the newMovie with :
onClipEvent (enterFrame) {
if (xx=12) {
xxx = 31;
}
}
onClipEvent (load) {
xxxx = 65;
}
onClipEvent (keyup) {
xxxx = 65;
}

So, how to assign the scripts to the new movie clip?

View Replies !    View Related
Removing Attached (linkage) Movie Clip
hi, need a help
i have attached my work file

actully i am trying to draw continues line one point to another by mouse click , and each points there will be a round shape(using linkage library method) with the mouse click .

the lines all are removed by this (_root.newgrid1.clear()) method.

the problem is that i was only able to remove one round shape from the stage using remove movie clip method,

how can i remove all the attached movie by the reset button from newgrid2?

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


This is the method i used to attach movie from library

var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------


################################################## ##
this is the method i used to remove the clip

_root.reset.onRelease = function () {

_root.newgrid1.clear();
_root.newgrid2.clear();

removeMovieClip(newgrid1);
removeMovieClip(newgrid2);

for (n in _root)
{

removeMovieClip (_root[n]);

}

}
################################################

View Replies !    View Related
Set Variable To Instance Name Of Attached Movie Clip
i don't know if this is possible or a dumb way of going about what i'm trying to do, but i need create a variable with a value equal to the instance name of a movie clip loaded in a container in the _root.

this totally wrong line of code might give a clearer indication of what i'm *trying* to do...

mc_name = getProperty (_root.container4, _name);

of course, i can't figure out how to do this without putting the instance name of the movie clip in the getProperty command (eg _root.container4.my_mc) but i can't do this because the instance name of the movie clip is the property i'm trying to get!

there must be a way to do this..no?

thanks!

View Replies !    View Related
Making Attached Movie Clip Clickable
Say I can create 200 different movie clips on the stage when I press a button and want to destroy them when I click on them, how would I do this.

I tried creating the movie clip:

ActionScript Code:
_root.attachMovie(box, "a342342", _root.getNextHighestDepth(), {_x: 200, _y: 200});
_root.a342342.onRelease = function()
{
gotoAndPlay("explode");
}

But it doesn't work. The attached object isn't click able in any way.

View Replies !    View Related
Removing Attached (linkage) Movie Clip
hi, need a help

i am trying to draw continues line one point to another by mouse click , and each points there will be a round shape(using linkage library method) with the mouse click .

the lines all are removed by this (_root.newgrid1.clear()) method.

the problem is that i was only able to remove one round shape from the stage using remove movie clip method,

how can i remove all the attached movie by the reset button from newgrid2?

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


This is the method i used to attach movie from library

var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------


################################################## ##
this is the method i used to remove the clip

_root.reset.onRelease = function () {

_root.newgrid1.clear();
_root.newgrid2.clear();

removeMovieClip(newgrid1);
removeMovieClip(newgrid2);

for (n in _root)
{

removeMovieClip (_root[n]);

}

}
################################################

View Replies !    View Related
Passing A Value From Attached Movie Clip To The_root. Help Please
Hi,
I have a attached MC which contains a short animation. I want to tell my control layer on the main movie that if that short animation in that attached MC is finished, so go on to do next step.
How can I define something which tells the main movie that attached MC has finished?
Thanks

View Replies !    View Related
Detecting Completed FLV In Attached Movie Clip
Hi all.

Kind of a beginner with Action Script.

I have a movie clip that contains an FLV using FLVPlayback component. When the video has reached the end, I want the main timeline to continue on. In the past, I have been able to do this using the code shown below. (The code is placed on the main timeline on the frame in which the video is playing.)

In the current project I'm working on this code is not working. My guess is because this time around, the contents of the movie clip in which the video is playing was generated using the attachMovie method.

Any help would be greatly appreciated.

David










Attach Code

stop();
//
// Listen for end of VLF
var listener:Object = new Object();
listener.complete = function(eventObject:Object):Void {
nextFrame();
play();
};
this.slide_mc.clip1_FLVPplybk.addEventListener("complete", listener);

View Replies !    View Related
Making Attached Movie Clip Clickable
Say I can create 200 different movie clips on the stage when I press a button and want to destroy them when I click on them, how would I do this.

I tried creating the movie clip:
ActionScript Code:
_root.attachMovie(box, "a342342", _root.getNextHighestDepth(), {_x: 200, _y: 200});
_root.a342342.onRelease = function()
{
gotoAndPlay("explode");
}


But it doesn't work. The attached object isn't click able in any way.

View Replies !    View Related
Q: Xscale On A Movie Clip With A Loadmovie Attached?
hi. here's my situation. i've loaded a movie onto a movie clip. then i use xscale and yscale on the MC to flip the loaded movie, using code like the following (flipVar equals wither 100 or -100):

_root.myClip._xscale = flipVar;

correct me if i'm wrong: for a regular MC without an swf loaded, this just sets the flip absolutely - if flipVar equals 100, it'll be normal and if it's -100, it'll be flipped... no matter what it was before this operation.
but it seems like with a loaded swf it sets it relative to how it was before the operation - if it was upside-down and flipVar is -100, it'll be right-side-up. is this all correct? if so, how can i flip a loaded movie absolutely?
your help is much appreciated!

View Replies !    View Related
Referencing A Button In An Attached Movie Clip
I am trying to code an onRelease function for a button located in a movie clip I've attached to another movie clip. It works for one button, but not for another, eventhough I think I've done them the same way. Here's the code:


Code:

his.stop();

//THIS PART WORKS
map_button_holder.map_anim_mc.btn_get_map.onRelease = function(){
map_holder.attachMovie("mapclip", "map_mc", map_holder.getNextHighestDepth());
map_button_holder.removeMovieClip("map_anim_mc");
map_button_holder.attachMovie("mapclose", "map_close_mc", map_button_holder.getNextHighestDepth());
trace("get map clicked");
}

//THIS PART DOESN'T WORK
map_button_holder.map_close_mc.btn_close_map.onRelease = function(){
map_holder.removeMovieClip("map_mc");
map_button_holder.removeMovieClip("map_close_mc");
map_button_holder.attachMovie("mapanim", "map_anim_mc", map_button_holder.getNextHighestDepth());
trace("close map clicked");
}
The movie clip "map_anim_mc" was attached (using attachMovie) to map_button_holder a few frames earlier, and btn_get_map works. Can anyone see what's wrong with my code, or what might be the problem?

View Replies !    View Related
Function Of Attached Movie Clip Can Not Beaccesses
Hi board,

why is it that when I attach a movie clip from the library during runtime that I can only access the functions of it after the current frame has been left and the playhead moved to the next one?

I need the functions in the same frame. How can that problem be solved?

Frame 1:


ActionScript Code:
play();
 
function attachTestMc():Void {
    trace("call before attach");
    this.attachMovie("testMc","testMc",1);
}
 
function functionTestMc():Void {
    trace("call after trace");
    this.testMc.testTrace();
}
 
attachTestMc();
 
//functionTestMc(); <-- can not call from here
 


Frame 2

ActionScript Code:
play();
 
functionTestMc(); // <-- call from here works
 
stop();

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved