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




If Movieclip._x == "500" Then...



I'm scrolling a movieclip with actionscript. The actions that do the scrolling are on individual keyframes according to the "pages". How do I tell a movie clip to load into a target only when the movie I'm scrolling is at a particular position?

This is my scrolling script:

startx = GetProperty(/:scrollMovie,_x) ;
starty = GetProperty(/:scrollMovie,_y) ;
horizontalno = /:scrollMoviex-startx;
verticalno = /:scrollMoviey-starty;
setProperty (/:scrollMovie, _x, startx+(horizontalno/8));
setProperty (/:scrollMovie, _y, starty+(verticalno/8));

Here's the code that passes the above script (on each keyframe) the value it needs to perform the scroll event:

scrollMoviex = -756;
scrollMoviey = -504;

Now I need to load a movie into a target only when scrollMovie ahs reached a certain position. Since each page's buttons execute the above code, which moves scrollMovie, do I therefore need to execute a function like this:

function waitLoad() {
if (_root.scrollMovie._x == "500")
{
loadMovie ("content_01.swf", "_root.content");
}
else
{
waitLoad();
}

...or append some logic like this to my scrolling script:

if (_root.scrollMovie._x == "500")
{
loadMovie ("content_01.swf", "_root.content");
}


You know what I mean: I'm trying to make the Barney's scroller act as a trigger for a loadMovie(), but I don't know precisely how to arrange it.

Any help's appreciated and will be submitted to all the threads related to this issue, if they're still current.

Mike



FlashKit > Flash Help > Flash ActionScript
Posted on: 12-10-2001, 12:57 PM


View Complete Forum Thread with Replies

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

On HitTest To A Movieclip(a) By Movieclip(b)i Want To Attach Another Movieclip(c) To
on hitTest to a movieclip(a) by movieclip(b)i want to attach another movieclip(c) to movieclip(b)which is in the stage,so how to do it??
can anybody help on this???

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers,

Sarge

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!!!!!!!!!

MovieClip.onRelease = MovieCLip.Protoype Function Fails To Execute Properly
Dear all,

I created a simpe function:

MovieClip.prototype.hiMe = function(me, theRest)
{
//declare the format colors white and grey
formatMe = new TextFormat();
formatMe.color = Colors[0];
formatMe.font = "Adventure Subtitles";

formatTheRest = new TextFormat();
formatTheRest.color = Colors[1];
formatTheRest.font = "Adventure Subtitles";

// assign grey to theRest
for (i =0 ; i < theRest.length; i++)
{
theRest[i].tfield.setTextFormat(formatTheRest);
}
// make the me white
me.tfield.setTextFormat(formatMe);

}

when I call it (bar[0] is an array of objects)
bar[0].invar.onRelease = hiMe(bar[0],bar);

it executes on load regardless of the onRelease eventHandler and the ownards it does not execute when exciting the event.

does somebody know why this may be?

Cheers

DDT

MovieClip.onRelease = MovieCLip.Protoype Function Fails To Execute Properly
Dear all,

I created a simpe function:

MovieClip.prototype.hiMe = function(me, theRest)
{
//declare the format colors white and grey
formatMe = new TextFormat();
formatMe.color = Colors[0];
formatMe.font = "Adventure Subtitles";

formatTheRest = new TextFormat();
formatTheRest.color = Colors[1];
formatTheRest.font = "Adventure Subtitles";

// assign grey to theRest
for (i =0 ; i < theRest.length; i++)
{
theRest[i].tfield.setTextFormat(formatTheRest);
}
// make the me white
me.tfield.setTextFormat(formatMe);

}

when I call it (bar[0] is an array of objects)
bar[0].invar.onRelease = hiMe(bar[0],bar);

it executes on load regardless of the onRelease eventHandler and the ownards it does not execute when exciting the event.

does somebody know why this may be?

Cheers

DDT

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers,

User Input Creates MovieClip Made Of MovieClip Symbols
Hello. I need some help either with my situation or with the search terms I'm using to try to find an answer.

I am using Flash MX Pro 2004.
I have drawn letters A-Z in Flash in two different styles (for example one that is furry and another that looks like metal). I would like users to select a text style (furry or metal) and enter text via text input field. When they have pressed an Enter button I would like the word to appear made up of the drawn symbols that I created.

I don't want to make an actual font. Any ideas on search terms to find the sort of thing I am looking for? Here's some that I've tried already:

convert text to symbols -- I get tons of results talking about putting textfields in symbols.

user input to symbols -- almost same results as above

custom fonts using symbols -- I get results talking about how to embed fonts and making text bold, italic, etc. Also not what I'm after.

All help is appreciated. Thanks in advance.

Scott

Receive Full Path To A MovieClip, Return A MovieClip Reference.
Hi, I got this function...

Code:
Function getMCPath(path:String)
{
var MC:MovieClip;
MC = eval(path)
return MC;
}

If I send "_level0" this will return _level0, but if I send "_level0.myMC" this will return undefined.

what should I do in order to get full path to _level0.myMC

Thanks in Advance,
DMZ

How To Hide My Current Movieclip And Display 2nd Dynamically Created Movieclip?
I have a movieclip in which there is an image create this movieclip dynamically by reading the oath of the image from file and play an effect. its working fine, now i want to hide this MC after its effect is ended and then dynamically want to create the other MC and similarly so on. how to do that. my code is as below:

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);

lv.load("data.txt");
var my_lv:LoadVars = new LoadVars();
my_lv.load("data.txt");
my_lv.onLoad = function(success)
{
if (success)
{
if(this.pic1!=undefined)
{
var ImgMc:MovieClip = createEmptyMovieClip("ImgMc", getNextHighestDepth());
_root.mcLoader.loadClip(this.pic1,_root.ImgMc);
//Some effect on ImgMc

//how to hide the ImgMc whe nits effect is played and then load another image in a movieclip and so on
}
}
}

Load Movieclip From Libary Into Another Blank Movieclip On Stage (URGENT PLEASE)
hi all i just need to know how to load a movieclip into a blank movie clip all in the same movie?! please help many regards peter thanks in advance!

Movieclip Rollover Effect Disables Internal Movieclip Buttons
Is it possible to have a movieclip rollover effect with another movieclip inside of it that is able to be clicked and do what it's scripted to do?

Let me try to get specific...


Movieclip 1 -- Has www.kirupa.com/developer/mx2004/button_effect.htm applied

Inside of Movieclip 1 --> Buttons that appear visible when you rollover the menu (it comes out of eases into view)

These buttons inside are not being allowed to be pushed because from what I can gather, the complex rollover is not allowing anything to be activated except the rollover effect.

So here's a diagram:

Rollover Movieclip 1 --> Eases it's bottom part up revealing 4 buttons --> These buttons when clicked are supposed to do an action --> Buttons cannot be activated for some unknown reason.

Can anyone help me out? I'm out of ideas after working on this for the past hour or so. If you need any extra info or materials, let me know; I'm sitting right here working on this problem haha.

-Indecisive

Problem With OnRelease For MovieClip Inside Draggable MovieClip [Flash Pro 8]
I have a movie clip, circle_mc, and in it is embed another movie clip, point_mc. I made the circle draggable with this:


Code:
circle_mc.onPress = function() {
startDrag(this);
};
circle_mc.onRelease = function() {
stopDrag();
};
and that part works fine.

I also want to be able to click on point_mc which is within the circle_mc movie clip. So, I added this:


Code:
circle_mc.point_mc.onRelease = function() {
trace("click was successful");
}
This does not work, and I'm pretty sure it is BECAUSE its parent clip is draggable and therefore has its own onRelease function. (If I comment-out the drag code, then the other code works as intended.)

Is there any way to do this or am I out of luck?

How To Load Image Into Movieclip Inside Movieclip That Is Dynamically Created?
Hello Kirupa Cats!

I am building a menu from an XML file, and I'm cool with cyclying thru the xml data to create menu items.

For every menu item in my XML file, I'm using attachMovie to insert a movie clip called menuitem from my library into a movieclip called menuholder. This works no problem, my menuholder movieclip is poplulated with as many menuitem movieclips from the library as designated by the xml data.

However, inside the library movieclip called menuitem, I have another movieclip on its stage, called mc_menuImage. I want to load an image into that movieclip, and I'm taking the URL for the image from the XML data.

My problem is I can't seem to figure out how to fully identify the movieclip mc_menuImage to load the image. It may have something to do with the fact that the library movieclip is being loaded dynamically, but the movieclip inside the library movieclip exisits pysically on the stage. I don't know...here's the code I'm working with:

THE CODE:

var xmlMenu:String = "menu.xml";
menuholder = createEmptyMovieClip("menuholder", -1);

var xmlMenuData:XML = new XML();
xmlMenuData.ignoreWhite = true;
xmlMenuData.load( xmlMenu );
xmlMenuData.onLoad = function(loaded) {
if (loaded) {
var mImage:Array = new Array();
var mRootNode = this.firstChild.childNodes;
totalMenuItems = mRootNode.length;

// fill array
for (var i = 0; i<totalMenuItems; i++) {
mImage.push(mRootNode[i].attributes.menuImage);
}
}

//make the menu
for (var i = 0; i<totalMenuItems; i++) {
var menuitem = menuholder.attachMovie("menuitem", "menu"+i, i);
menuitem.id = i;

/* now here I thought I could just do this: */
menuitem.mc_menuImage.loadMovie(mImage[i]);
/* but that doesn't work... */

};


When I trace menuitem I get this: _level0.menuholder.menu0, _level0.menuholder.menu1, etc, so I figured the syntax menuitem.mc_menuImage would identify the movieclip inside menuitem, but to no avail. Maybe it has something to do with levels, I'm not sure...

So I don't know, any suggestions? Thanks so much!!!

How To Scale The Movieclip Without Transform The Text Inside That Movieclip Uisng As
hi
how to scale the movieclip without transform the text inside that movieclip uisng actionscript


thanks in Advance

Wait Till Movieclip Gets To Particular Frame Then Play Another Section Of Movieclip
Hi,

I'm trying to reconstruct http://www.kswissfreerunning.com/AU/ with movies of my own.

Basically I have an array that contains the letters the user enters and I have the movie in a separate moviecilps with labels representing the letters.

I have a (what I think) logical set of code here to run through each letter in the user enters:

Code:
for(var k=0; k < letterArray.length; k++){
movie_mc.gotoAndPlay(letterArray[k]);
}
The problem is that it will only play the last letter the user enters. How am I able to make my flash wait till it gets to the end of a section of the movieclip, then play the next one, without it rushing to go straight to the last letter.

My pseudocode looks like this:

For the length of the array
play the next letter
when that letter movie gets to the end
play the next letter

Thanks in advance.

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!

[HELP] DuplicateMovie / AttachMovie Movieclip Located Inside A MovieClip To Root
As title.

Example:
I have a movieclip(innerClip) inside a movieclip(mainclip).
Is there anyway if I duplicate / attach my innerclip to my root stage? So I can access it like _root.innerclip2, instead of normal duplication that make to _root.mainclip.innerclip2

Thanks in advance.

Control/sinc Video Movieclip And Text Movieclip
Here´s a tricky one:

I need to sincronize/control a movieclip with texts and a swf (a video) that I loaded, both on the main timeline.

I have a swf (a video) that I loaded in a movieclip into my flash file and a movieclip with texts in it. Both are on the main timeline. Trouble is if the movie is playing and I want to pause it, for example, the swf video pauses but the texts movieclip keeps on playing. If I rewind it, the swf video goes back, the text movieclip still keeps on going. You get the picture.

For control I´m using a camtasia component - camtasia is the software I made the video with. I´m not putting the movie straight into the flash file because the swf made with camtasia turns to be way smaller that if I just loaded into flash.

I´ve attached a txt file with the controller script. Also i´ve put for download the flash file i´m talking about (flashsinc.zip) so you can better understand what I mean. Here´s the adress:

http://www.altoqi.com.br/temp/flashsinc.zip

Thanks a lot.

Trapping Mouse Events For A Movieclip Inside A Movieclip
Hi

Im having a few problems with my events for some movieclips. What I have is an AS2 class which creates a blank movieclip as a holder for submenu movieclips. This blank movieclip must trap its onRollOut event so that it can fade out the menus. The submenu movieclips which are then attached to the holder clip must trap their own mouse events which are defined in another AS2 class. The only trouble is they are not trapped.

I have seen a couple of other posts on the subject but got no clues from them. I was just wondering if what Im trying to do is possible or if Im fighting a loosing battle.

Any help would be much appreciated.
Thanks in advance
Dan

Mouse Event Triggers For Movieclip Inside Movieclip (can It Be Done?)
'canvas' is a large movieclip I am using to put other movieclips 'in' so I can move around and zoom everything at once. Like a coffee table with pictures on it.

I am loading up two images below with variables named map01 and map02. They overlap.


Code:
var map01:MovieClip = canvas.createEmptyMovieClip("map01", canvas.getNextHighestDepth());
map01.loadMovie("http://imagelocation1.jpg");
map01._x=-1000;
map01._y=39;
var map02:MovieClip = canvas.createEmptyMovieClip("map02", canvas.getNextHighestDepth());
map02.loadMovie("http://imagelocation2.jpg");
map02._x=-1000;
map02._y=130;

map01.onRelease = function () {
this.swapDepths(map02);
}
I would like to be able to click one of the images inside canvas and have it jump to the top. In this case, just a simple swap with map02 would be fine, I can manage the depths.

I have put a breakpoint right on the swapdepths line and debugged, and the function never gets called. Probably because it is the onrelease is for 'canvas', not any of the sibling movieclips that flash is looking for.

'canvas' has an onRelease that triggers a stopdrag and a onpress that triggers a startdrag. Removing these two triggers still does not allow any triggers for map01 or map02 to trigger though.

Any suggestions?

Is there some way to setup some logic on a canvas.onRelease function that can easily check to see if the clicked region is on an movieclip inside the canvas?

[F8] MovieClip._currentframelabel Would Be Nice Or, MovieClip.gotoAndStop(_nextlabel)
Ok, so, to my knowledge, up to AS 2.0, there is still no way to return the value of a frame label, correct? Or better yet, why haven't "they" added a "_nextFrameLabel();" or "_prevFrameLabel();" method!?!? Flash has the ability to move the playhead 1 frame at a time just by using the _nextFrame(); and the _prevFrame(); soooooooooo why can't it have the same function, just with frame labels!!!?! e.g. I have a Forward button that would have:


Code:
on(release){
_nextFrameLabel();
}


This would take me to the next frame which has a label, regardless of what it's called... the label could be "c", or "gibblets", or "blahblahblah"...

Or, if there was a property similar to MovieClip._currentframe, which, instead of returning an integer, it would return a string value if the playhead is on a labeled frame! e.g. MovieClip._currentframelabel would return "gibblets" instead of 145.

Basically, if I have a long linear animation with a bunch of manual stops and pauses put into the timeline, I want to avoid having to put a new keyframe in for the "Step Forward" and "Step Backward" buttons every time the playhead reaches a new stop/frame label. Has anyone figured an easier way to do this?

Example:
I have a timeline with 4 labeled frames, A, B, C, D... frame 1 is labeled "A", frame 50 is labeled "B", etc.
I have a layer with a Back and a Next button. So, on frame 50 (labeled "B"), the code for those buttons would be:


Code:
// Back Button
on(release){
gotoAndStop("A");
}

// Forward Button
on(release){
gotoAndStop("C");
}


In order to change that code (e.g. when the playhead gets to the "C" frame) I need to add a keyframe on the button layer... which is fine for this example where I only have 4 sections to deal with... but it's a pain when I have frames "A" through "W" or much more.

Is there a way to dynamically know what the next frame label is with ActionScript without implicitly definining it, thereby removing the necessity for numerous keyframes/code changes for the Back and Next Buttons???

i.e. instead of gotoAndStop("C")... I want gotoAndStop(_nextFrameLabel);

[CS3] Referencing A Movieclip Inside A Movieclip From A Class File
Hello All,

I'm trying to access a movieclip inside another movie clip from a class file that is not attached to either movieclip. For instance, I'm checking hitTests for the avatar the player uses on the game, there are two enemy movieclips. Inside each enemy movieclip is another movie clip that serves as a bounding box (specifically around the mouth of the enemy so it can eat the player). Here is what I have so far that isnt working:


Code:
if (_root['otter']['obbox'].hitTest(this) && touch == false) {
trace("Otter touched Urchin");
gotoAndPlay("hit");
_root['otter'].gotoAndPlay("eat");
touch = true;
}
The class file is for the avatar. On the stage is the otter mc and inside the otter mc is another mc called obbox which is what I'm trying to hitTest against. Needless to say, it doesn't hitTest or trace or play the animation. Is there a way to reference a nested mc? Thanks in advance.

Terror.

Determining The Name Of A Dynamically Loaded Movieclip From A Child Movieclip
I had posted earlier on this topic, but I don't think I was clear enough in my title, or description.

Here's a more detailed explaination of what I I'm trying to do:

I have a .swf file that dynamically generates container movieclips (giving them dynamically generated instance names) and then dynamically loads external .swf files into it.

In my main time line I have a series of objects.

I would like to be able to, from the loaded .swf files, make a call to the objects in the _root timeline (which I can do without a problem) letting these objects know, the name of it's dynamically generated container movieclip that contains my loaded .swf.

1. Parent SWF:
|
2. Dynamically Generated MovieClip Instance:
|
3. Dynamically loaded external SWF File:
. Script needs to know the name of the instance
of #2.

In 3. I tried using the _parent and _parent._parent to get a reference to #2. but all I was able to get was "_level0".

I've also tried using _lockroot (which somone else kindly suggested) to no avail.

Any help is greatly appreciated

Attaching A Movieclip At A Specific Location Inside Another Movieclip
Hello all,

I am trying to attach a movieclip(a) inside another movieclip(b). When (a) is attached it is always attached at the top left corner OR if I use getNextHighestDepth() then the movieclip (a) is attached randomly at different locations. I would like (a) to be attached at the centre of the parent movieclip or at a specific location inside parent movieclip.

Please help me with this. Me a newbie to actionscripting.

Thanks,

Nish

Child Movieclip Staying Within Boundries Of Parent Movieclip
I am trying to create a child movieclip that should only be displayed within the boundaries of the parent movieclip.

Lets say I have a stage of 800x600 pixels. The parent movieclip is 600x400 pixels. When I create a child-movieclip and place it at _x = 650, the movieclip "disapears" as it is outside the boundaries of the parent movieclip.

I'm pretty sure I am doing something wrong in the creation of the child movieclip, but can anyone help me PLEASE!?!

- mortenft

Dynamic Movieclip Resizing With A Textfield Inside Of The Movieclip
Hello,

I've searched past posts in regards to resizing textfields but I was unable to find any help with the problem I am having resizing a movieclip that contains a textfield.

Basically I am dynamically creating an emptyMovieClip, then within that empty movieClip I am then creating a text fielld and populating it with text.

When I try to resize the movieclips instance by clicking on a button and changing the ._width of the movieclip and it fails.

Please help,

frank grimes

Unable To Select Previous Movieclip After Duplicate Movieclip
i have a movieClip and was able to duplicate the movieClip. But now the problem is, after i have duplicated the movieClip i cannot select the previous movieclip which don allow me to move it around. Is there anyway that will allow me to select my previous movieclip after duplicated?

Below is my code:










Attach Code

var mySelection = "";

wire.onPress = function ()
{
this.createEmptyMovieClip("mc1", 90);
duplicate(mc1);
mc1 = attachMovie("idwire", "wire1", 91);
mc1._x = 273;
mc1._y = 196.5;
dragging(mc1);
}

function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}

function duplicate(mc)
{
amount = 50;
while(amount>0)
{
mc.duplicateMovieClip ("mc"+i, i);
i++;
amount--;
}
}

SetProperty Doesn't Work With Movieclip Inside Of Movieclip
I originally had this set up this way and it worked.

var hita:Boolean = false;
logotop.onEnterFrame = function() {
hita = this.hitTest(this._parent.middle.hitme);
if (hita == true) {
setProperty ("logotop", _alpha, "0");
}
}

Then I put everything in a new movieclip with the instance name "printme".
Now it doesn't work and doesn't give me an error.

var hita:Boolean = false;
printme.logotop.onEnterFrame = function() {
hita = this.hitTest(this._parent.printme.middle.hitme);
if (hita == true) {
setProperty ("printme.logotop", _alpha, "0");
}
}

Do you see anything wrong with the above code?

How Do You Call A Function In An Attached MovieClip From The Current MovieClip?
Hi there,

I have this MovieClip A (converted as a symbol) and put in my main MovieClip B using attachMovie() , and I am wondering how I can call a function defined in A from within B.

Is it possible?

Thanks

How To Swap Movieclip With Other Content, In A Movieclip Loaded External
Hi! I'm getting desperated.

I started about 3 days ago trying to solve this problem, maybe i'm very noob!

I have a main movie. Inside this, i load various externals swf's. One swf for a menu, another for a image presentation, etc.
In the menu, i load various instances of another swf file... a button swf, and witch one has to have a different image as button.
So inside the button, i have a layer with a button, but no shape or nothing, and in another layer, i have a movieclip to can swap by an image.
So, the struct is like this:

Main Movie
. image_presentation
. contact
. menu
. . button1
. . . button
. . . image
. . button2
. . . button
. . . image
. . button3
. . . button
. . . image
. . button4
. . . button
. . . image

So, button is only a swf file, with various instances. "button" inside the buttons, make the button efect, with a white border apearing on mouse over button. "image" is a movieclip created only for change with an image (button 1 = image 1, button 2 = image 2, etc).

How can i do this, controlling the images url's from the main movie?? I had tried a lot of ways, but i could do it.

Please help.

Thanks.

Duplicated Movieclip Doesn't Inherit Loaded Movieclip
I'm loading an image into a blank_mc within a movieclip called 'background_mc' using the MovieClipLoader object; when the onLoadInit for the MovieClipLoader object is fired, i then attempt to clone my 'backgound_mc' object and the loaded image it contains so i can do something with it (i,e a funky masky/blur thing, not important right now)

I'm successfully loading my image into the blank clip within background_mc, the onLoadInit behaviour fires and duplicates background_mc once the image has been loaded, but in a disappointing turn of events, my clone of background_mc no longer has an image attached, and has instead reverted back to it's original form, just as ti was before it had the jpeg image loaded in.

Has anyone ever encountered something like this this before regarding the duplicateMovieClip command, and if so can anyone suggest a workaround?

*goes off to boost karma by helping others*

Thanks!

Chris

Exending Movieclip Class With Your Own Movieclip And How To Create Children In It.
I was writing actionscript for a custom movieclip class I made.
Created my movieclip in flash and linked it as Dude class.

One question: Is it possible to override the constructor? I tried to do it but flash gives me an error "duplicate function definition"

Another question: How do I create a displayobject in this movieclip? I tried to do something like this inside the actionscript for the Dude movieclip.

Code:
var mytext:TextField = new TextField();
// code to change textfield's properties
addChild( mytext );
But when I created an instance of Dude on the stage the textfield isn't showing.

Getting A Movieclip To Match The Coordinates Of A Movieclip, Inside A Moiveclip.
Quick question. Is it possible for a movieclip to go to the coordinates (x,y) of another movieclip that is within a movieclip?

Filling A MovieClip With A Small MovieClip And Tiling (beginBitmapFill?)
Hi all, I was hoping to get a little guidance from the AS pro's. I have a movieClip that is 500x500 in one of my movies that I would like to add a tiled background to. This tile will be very simple something like 4x4. I have been reading up on the BitmapData class and figured this would be the best way to get this done and use up the smallest file size.

But I am not 100% understand if that is the best solution. Anyone have any thoughts? After reading up on full page flash movies I figured that method should be able to be applied to individual movieClips as well.

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("@");
};

Apple A Color Transformation To A Movieclip That's Inside Another Movieclip
Hey,

I have a movieclip with it's .mouseChildren property set to true. In that movieclip are about 30 other movieclips, and inside each of those movieclips is a single dynamic textfield. I did this so I could set the .buttonMode to true on the 30 movieclips that are in the main movieclip so I could have the nice pointer finger/glove. When I mouse over the main movieclip the pointer finger/glove shows up as it's supposed to. What I want to do is apply a color transformation to the movieclip as I mouse over it. Here's what I have that isn't working:


Code:
function onFeedMouseOver(e:MouseEvent):void
{
var feedColorOver:ColorTransform = e.target.colorTransform;
feedColorOver.color = titleTextOverColor;
e.target.transform.colorTransform = feedColorOver;
}
I have verified that the function is indeed being called, and the color variable is working.

Any help would be very much appreciated.

P.S. The project is a rss reader where the user can select what feed they want to view from a scrollable list that is parsed form an xml file, then the feed will load and display the title, date, and short description of all the feeds for the user. Then it scrolls through them (it loops continuously). When the user clicks on the feed, it takes them to the article/blog post/whatever in a new tab or window. Everything works great, this is basically the last thing I need to do for it. This particular portion of the project is when the user mouses over the list of feeds.

Adding A Dynamic Movieclip To A Dynamically Generated Movieclip
Code:
var _mc:MovieClip = new MovieClip();
var this['clip_new'] = new MovieClip();

for (var _i:int = 0; _i<10; _i++){
this['_clip'+_i+''] = new MovieClip();
_mc.addChild(this['_clip'+_i+'']);
}
addChild(_mc);

this['_clip0'].addChild(this['clip_new']); // error
how to add a dynamically generated moviclip as a child, to a dynamically generated parent movieclip .. pls help

Movieclip.prototype.distance=function(movieclip) ?
hi,
I want to know want does this mean:
Movieclip.prototype.distance=function(movieclip){

please help
Thank you

Play Specific Frame Of Movieclip From Other Movieclip
now this may look like simple stuff but it is not happening.
i ve made two movieclips 'menuball' which is animates the small ball inside the scene (like a bullet for menu item) and 'menumain' where 'menuball' is embedded and small text which is button.
now i want when this button in 'menumain' is pressed. the 'menuball' clip shud be played from 12th frame onwards. this will basically withfraw the ball from the scene.
i ve used simple code
on(release)
{menuball.gotoAndPlay(12);
}
or
this.menuball.gotoAndPlay(12);
or
_root.menumain.menuball.gotoAndPlay(12);
and many more like this
but none is working
i am attaching the small fla file. please help me in this. i am not getting any solution. and my whole work is stuck coz of this.

Extend Class Movieclip And Movieclip Off Stage
Hi all,
Using Flash 8 and getting over to AS2.0 I got this problem. Could not find any answer on the forum until now.

I am trying to get some more grips on AS2.0 and do this by making a small game. On several frames are movieclips: mc1 mc2 etc. When the user clicks on them, the total number of clicks is recorded (among others) for each movieclip. On different frames are different movieclips.
I tried three ways.

1. First I defined a class MyMovieClipClass extends MovieClip with:
code:
private var clicks: Number
private function onPress: Void {
clicks++;
// do other things
}
public function howMuch: Number{ // return clicks }

Movieclips mc1, mc2, etc are defined being a member of this class in ‘linkage’.
The problem arose that when on a frame without mc1 I could not access mc1.howMuch() becase in that frame there is no mc1.


2. Then I defined two classes MyMovieClipClassA and MyMovieClipClassB
The movieclip on stage mc1 is a member of Class A and var clicks is in Class B.
The instance name of class B is derivated from the instance name on stage:
mc1 (ClassA) is kindof connected with mc1_obj (ClassB)
MyMovieClipClassA extends MovieClip with:
code:
private function onPress: Void {
// make instName = this._name + “obj”;
instName.clicks++;
// do other things
}


MyMovieClipClassB with:
code:
private var clicks: Number
public function howMuch: Number{ // return clicks }


In the timeline I then define:
code:
var item1: MyMovieClipClassA = new MyMovieClipClassA();
var item1_obj: MyMovieClipClassB = new MyMovieClipClassB();

which is not very elegant.
(the movieclip to which this belongs has the name item1)

3. I tried to declare ‘_name + “_obj”’ in de constructor of ClassA but did not succeed.

Anybody any suggestions for an elegant solution in which different movieclips in different frames on stage can be tracked using classes?
Thanks in advance for your reaction.

Moving An Embedded Movieclip To Another Parrent Movieclip.
First the heirachy.

Code:
|----(MC1)
|
(_root)-----|
|
|----(MC2)----(MC3)
When I click on MC3 I need it to create a duplicate of itself inside MC1 so that it looks like this:

Code:
|----(MC1)----(Copy of MC3)
|
(_root)-----|
|
|----(MC2)----(MC3)
I can't use .attachMovie() since I need the script to be duplicated also. So I need to use .duplicateMovieClip() and somehow move the duplicate to the

[F8] Assigning A Movieclip To An Attached Movieclip Dilemma
I attached a movie clip:
customer = _root.attachMovie("customer","customer"+number,_root.getNextHighestDepth());

I want to attach another clip that is unique for each customer being attached by:
customer.timer = _root.attachMovie("ticker","ticker"+number,_root.getNextHighestDepth());

Will the timer be attached and identified for each UNIQUE customer?

[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");
}

[FP8 / AS2]Movieclip Audio Causing Other Movieclip Slowdown
The playback of sound effects from one of my game object's movieclips (such as an alien shooting) is causing other game objects (i.e. the walking hero) to judder in their movement, only while that audio is playing from the other object.

But when I delete the audio from its layer in the movieclip, there are no problems.

Any suggestions on what might be happening, and where I might start to investigate, would be appreciated.

I'm coding on Flash CS3 in AS2 for Flash Player 8. Playing on Windows XP SP2, on a 2 GHz desktop and 1GHz laptop (the problem happens on both.)

The CPU is NOT going super high when the problem happens.

Movieclip Inside Movieclip Not Responding To Keypress
I am a beginner with Flash. I am using Flash 8 and am trying to make my very fist arcade game. I am starting with basic keypress and movement. Can't get this to react how I want. I attached the actual .fla file(if I attached it correctly). The movement doesn't include LEFT, RIGHT, UP or down or anything like that. It is only "two" movements. When the user is not touching the keys, the movie clip of the character is sent to his standing pose, which is a moving animation of him swaying back and forth. When the user presses the spacebar, he punches. This is the code, which works fine:

onClipEvent(enterFrame)
{
if(Key.isDown(Key.SPACE))
{_root.subzero_man.gotoAndStop("punch");
}
else
_root.subzero_man.gotoAndStop("standing");
}

This code is attached to the movie clip which is on the main Stage, main Timeline.

The problem is this: you have to be HOLDING DOWN the spacebar to see the punching occur. I don't want the user to have to hold down the spacebar. I want the user to be able to TAP the spacebar and the punch movie clip plays completely(within its own independent timeline).

So I changed the 4th line in the code to this:
{_root.subzero_man.punch_instance.play();

The name of the character on the main timeline is still "subzero_man", and now the name of the instance of the character punching is "punch_instance".
However, nothing happens. The character stays in his standing pose, ignoring the spacebar keypress.

I thought this was the correct syntax for referring to a movieclip instance which is inside another movie clip. In this case, the punching movie clip instance is inside the subzero character movie clip instance which is on the main timeline.

Is my code wrong?

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");
}
}

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