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




AttachMovie Ques



Hi - I'm using the code below to bring mcs from the Library to the stage. It works fine until I tried to add the x,y at the end.I thought there was a way to include _x and _y coordinates to the same statement as the attactMovie. Is there?TIA the correct way to accomplish this.jlAttach Codemc_btn2.btn2.onRelease = function():Void {attachMovie("Q2WithGame","Q2Game",this.getNextHighestDepth,[_x=45,_y=110]);};



Adobe > ActionScript 1 and 2
Posted on: 04/25/2007 08:48:15 AM


View Complete Forum Thread with Replies

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

Nav Ques
Hey guys I seem to remember a thread regarding how to make this kinda of NAV :

http://dopepope.com/ntps/Build_onff/


Anyone remember the thread or have a link on a tutorial to dup that kind of load jpg and have the window resize automatically...thanks all

_parent. Ques
im trying to load an external jpg. and the file name of this jpg is the name of the mc 2 levels above the command.
if u dont understand this is thi code im trying to use

Code:
x = _parent._parent._name;
loadMovieNum("x".jpg, 1);

i also tried putting th eparent crap in the load move itself like this

Code:
loadMovieNum("_parent._parent._name".jpg, 1);

and its still not working. any one able to give some advice

Simple AS 1.0 Ques
AS 1.0
I have this code in a keyframe on the main timeline:

var score = 0;
if (score == 2500){trace("winner")}

Othe stage in the maintimeline i have a dynamic text field I labeled "score" in the var box. The instance name is "pts" but i wasnt sure if i needed an instance name anyway here. The score box works fine as far as keeping score but when it reaches 2500, I dont get my trace. What am I missing? Thanks

-Chris

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Attaching MC Ques
hi.. anyone out there can give me a tutorial which teaches attaching a MC to another MC?? urgent..

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Flash Ques
please can you explane me how can I make this file like on this site:
http://www.t-s-k-b.com .You go on this site and press SAKUBA WORKS and then button Painting/Drawing

I would like to make a picture gallery like in Painting/Drawing: So how I can make when the mause on the button to show small image of the picture and when I press the image to open the picture how is on the site(not in a new window)?
Please tell give me advice how could I make it!
thank you

Another Loading Ques
Is it possible to make the movie load let's say... only the 1st 2 frames of movie that has 8?

Button Ques
Ok real dumb ques..I have this animation..u can dl it from here: www.zeroxposur.com/test/nav.fla
So what I want to do is have 5 buttons fade in ..onto the bar as it finishes its animation..but I dont know how to do it.. Can anyone point me in the right direction. Thanks

Easy AS Ques.
ok so I have a flash doc..theres a an MC called target on mainstage that has the entite site in it (doing a fullscreen centered website)..now I have MC nav buttons on the stage (inside target). Inside one of the nav buttons I have a line of AS that says


ActionScript Code:
this.onRelease = function(){
    _root.target.loadMovie("bioresume.swf", "loader");
}


Now im not sure If im doing that right..but what i want to happen is; after u release the button, load the ext swf into the empty MC called "loader". But what seems to be happening is it loads the ext swf but everything else on the site disappears. See I originally had this as my AS cause i thought this made sense but it ends up not doing anything:


ActionScript Code:
this.onRelease = function(){
    loadMovie("bioresume.swf", "loader");
}


So if anyone knows what I did wrong, much appreciation. Heres the site link if u want a visual:

www.josephsernio.com/test

Easy As Ques.
Ok for some reason the end of this code doesnt work.. on release, i want it to take me to frame 2..and it wont...btw this a movie clip that has button properties through AS:



stop();

this.onEnterFrame = function(){

if(rewind == true){

prevFrame();

}

}

this.onRollOver = function(){

rewind = false;
play();

}

this.onRollOut = function(){

rewind = true;

}

this.onRelease = function(){
gotoAndStop(2);

}

MC Loader As Ques.
im working with the moviecliploader AS..so a button loads an ext SWF and also has a percentage loader .. so on my mainstage i have a loader mc (instance name "loader")and a holder mc (instance name "holder")..heres my AS on the main timeline:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + "%";
}

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);





Now i have another MC that houses about 20 or so buttons..so within the buttons MC i have say this for one of the buttons:

b4sub.onRelease = function() {
_root.loader._visible = true;
_root.mcl.loadClip("LevisCampaign.swf",holder);



And unfortunetly it doesnt to load the ext. swf..did I code the _root incorrectly?

Thanks for your help.

Fscommand Ques
Hi all, I was working with fscommand, when it struck me what FSCOMMAND stands for.

"Future Splash Command"

Can anybody confirm this, or am I mad, lol

Later

ORANGE900

LoadVariables Button Ques
Hello all. I have this code attached to a button calling up a different text file to a dynamic text field and it works fine, except I'm having to hit the button "twice" for it to work. Can't figure out why. Can someone enlighten me please?


code:

on (release) {
scrolltext = scrolltext1;
loadVariables ("scrolltext1.txt", scrolltext1);
}

Thanks in advance

Easy - Pong AI Ques.
Ok just to see if I could do it(never really got into game programming) I tried to make a pong game everything works so far but I have a problem with this:
Flash code:

PHP Code:



onClipEvent(enterFrame) {
if(_global.cspeed == 0) {
}else{
    if (this._y != _root.ball._y){
        if(_root.ball._y < this._y){
                this._y -= _global.cspeed;
        }else if(_root.ball._y > this._y){
                this._y += _global.cspeed;
        }else{
                this._y = this._y;
        }
    }
}
}




The problem is that instead of moving smoothly up the screen it looks like it s shaking up and down really quickly, but I would like it to be smooth.
Please help.

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

Quick Mask Ques
Im sure this is an easy one.. on the foofighters website http://www.foofighters.com When U click a button that flourish/swashy graphic looks like it is unwinding or growing rather. I would like to get the same effect.. Its obviously a mask of some sort. I know who to mask, im just figuring its a mask that is animated somehow. Anyone have an idea? Appreciate any insight into this. Peace

-R

Quick Actionscript Ques.
Ok so im building a portfolio website and basically if you click on the art image it goes tothe next art image..I have it set up so the art images are buttons and when u click it, it is coded to goto next scene..On one scene however the art image is a movieclip (fading effect)...now how do you write the actionscript so if you click on the movieclip it goes to the next scene? I dk im right but...my guess is to put the MC within a button symbol? But I dk. Thanks guys.

UI Text Input Ques.
Ok so Im making a form in flashmx2004..I drag out onto the stage the UI compnent textinput box..now I want to make this box multiline but it doesnt give me the option to do so. Do I have to make input boxes in a different way?

Motion Guide Ques
Hi all,
Is it possible to create a motion guide, so the object connected to the motion guide is always in the centre of the screen.

What I mean is, if we were trying to go from point A to point B
we could see the full journey of the object travelling along motion guide in the centre of the screen.

A-------->--------->-------->------B

The sort of thing I mean is included, but with no motion guide instead, the car remains in the centre of screen and is able to move around the track which in turns moves the the track below.

Thanks for your time, sorry for the broken language. Hope you can help.

--------------
FLA = MM2004

<> QUICK QUES RE:Positioning After Dupe
Hi Im using a while loop and the dupliacteMovieClip() to dupe a certain number of my Mc's. I want to postion each duped Mc after its created with setProperty but I cant figure out how to do this within the same loop.
It complains in output box:

Symbol=playlist_Mc, Layer=Layer 2, Frame=1: Line 9: Expected a field name after '.' operator.setProperty(_root.playlist."box" + count, _y, vertpos);

Obviously I cant do the <"box" + count> bit, but how else can i do it?
(see code below)



Code:
onClipEvent(load){

var vertpos = 46;
var count = 0;
//create
while(count!=4)
{
duplicateMovieClip(_root.playlist.box, "box" + count, 1);
-->this doesnt work//setProperty(_root.playlist."box" + count, _y, vertpos);

trace(count);
count++;
}
//position
}


-Rich

Pleez Help With Random Keyframe Ques.
I have four different movie clips on four different keyframes (2-5) the first key frame has a clip with an invisible button over it. WHat I would like to achieve is onMouseover of the button in the first frame......I would like the playhead to randomly gotoAndStop on of the other frames (2-5). To give the illusion of random movement. The on mouseout return to the first keyframe. any help greatly appreciated....either a .fla I can study or some AS would be great.

Probably Simple LoadMovie Ques. For JPEGs
I have a target MC that I want to load some JPG's into in my Flash Movie. The Target MC's dimensions are 650x500px. The JPG's are the same. When I attempt to load them, I can notice that something has changed in the tone of the movie clip (I had the target MC a grey color then that color disappears) but the JPG does not load.

I tried a smaller JPG, like 1/4 the size, and it loaded OK. ANyone have a suggestion?

Action Script Ref Code Ques
Hello i keep getting this this action script error when i attempt to render this swf could some one explain what this error message means ......i am not sure what the variables are looking for ....... the version is Flash 8 - the action script is below and the error message is below that.......

#include "lmc_tween.as"
//classes are loaded on this frame
var state:com.collection.State = new com.collection.State(this);
// start program
var main:com.collection.Main = new com.collection.Main(this)
//
bg_img.tween("_alpha",100,1,"linear",.5)
stop()

Error message (below)

**Error** Scene=Scene 1, layer=actions, frame=5:Line 1: Error opening include file lmc_tween.as: File not found.
#include "lmc_tween.as"

**Error** Scene=Scene 1, layer=actions, frame=5:Line 3: The class or interface 'com.collection.State' could not be loaded.
var state:com.collection.State = new com.collection.State(this);

**Error** Scene=Scene 1, layer=actions, frame=5:Line 5: The class or interface 'com.collection.Main' could not be loaded.
var main:com.collection.Main = new com.collection.Main(this)

Total ActionScript Errors: 3 Reported Errors: 3

Action Script Ref Code Ques 2.0
Hello please see this link it is a follow up to the thread i created before....i am stil trying to figure this error out when i generate the flash swf it works but not properly... below is a link to what the swf looks like there are buttons that should show and i get this message (shown below) in the flash error box that says (output) when i hit ctrl+enter to generate the swf.... any suggestions...?

b1,b2,lgText,redText,arrow,a:link,a:hover
yo

http://www.amjaydesign.com/mainCol.html


http://board.flashkit.com/board/showthread.php?t=744878

Simple Ques About Blue Border Box
I'm using flash 8. When you draw something or import a picture flash 8 puts the blue border box around it. Well mine is gone. If I draw something and click on it it is a broken shape. How do I get the blue border box back?thanks

Loading Clips Into Levels? -quick Ques
Hi, I need a quick bit of code or at least somebody to give me an idea on how to actually have a clip load itelf into a specific level depending on the value of a variable. I want to do this as my duplicateMovieClip() code is putting MC's on higher levels than other elements (other Mc's) in my movie, and one of these elements in perticular needs to be the 'highest'.

I tried using setProperty() as below but it doesnt work, flash complains (I gather it doesnt consider '_level' as a property?)

Code:

setProperty(need2BHighest_Mc, _level, highestLevel);




Any help appreciated

Html Code Inside Flash Ques
I have a client who wants me too put some html inside the flash actionscript. He's not sure it will work and I'm not sure if it's possible or how to do it. Here's the code any suggestions thanks

<form action="/gift/save/1234" enctype="multipart/form-data"
method="post">
<input name="file" type="file" />
</form>

AttachMovie() Within Another AttachMovie() Created Instance?
I'm still struggling away on my web site, but I've made quite a bit of progress and I think my code has cleaned up quite a bit. I still have the issue of not being able to attach my new content box movie clip when the button is pressed. I am successfully able to load the data for that instance of the tab, and can access the variables. It also is able to run the newContentBox() function inside it with success, but when it tries to run attachMovie(), nothing happens. Could this be a problem with my depth? Or is it my nesting?

I have been thinking about making a global variable for depth that will increment each time anything is created, so every movie clip is guaranteed to be on its own depth. Would this be a solution?

The site can be viewed here.
The source can be viewed here.
All the data files are located in that directory as well.

This is really driving me nuts, and I want to get something solved so I can move onto the submenu creation.

AttachMovie Inside Another AttachMovie
is it possible to attach a movieclip, and then attach another inside of it? i'm trying to load in images via using loadMovie and XML (a little background) i want the image to be dropped in to have a mask applied to it so that the image appears as a rounded rectangle... here's my code for the for loop that attaches the movie clips...


PHP Code:



for (i=1; i<=totalImages; i++) {
                attachMovie("multiplebox", "box_"+i, i);
                movieNamer=_root["box_"+i];
}




is it possible to attach a movie inside of 'box_"+i'?

AttachMovie Within An AttachMovie? Not Working
So I've finished a project (let's call it Project Blue) where I use attachMovie which references a folder (of swf's) to place each page of the swf. It worked fine. Next, I made a master 'shell' to place this project (among others) into. To do that I used attachMovie again to place Project Blue in the shell.

But now my attachMovie pages for Project Blue won't show up. Does Flash have a problem with using an attachMovie within an attachMovie?

Thanks for any insight on this....

AttachMovie Nested AttachMovie...
I have in the root timeline an empty movie clip that loads other movies inside of it. Using the attachMovie function.

Inside one of these attachMovie clips I have a nest "attachMovie" clip as well but for some odd reason it's not working. Is there anything I should be aware of when nesting an attached movie?

AttachMovie
I’m using the attachMovie command and I need to remove the attached movie. I’ve tried unloadMovie, removeMovieClip, delete, and unloadMovie. I can get the clip to do anything else. A friend suggested I try to delete a layer but I don’t know how. Oh this is the important part I need the script to be in the Movie Clip.

Thanks in advance,
Slow21969

AttachMovie HELP
Okay guys, I've been trying this code for literally 18 hours, with no luck at all. I know for some of you this is going to be a walk in the park, so please help me out.
All I want to do is have a blank stage. On frame 1 of this main stage, I want some sort of code that will attachMovie. I can get through there just fine. My problem is this. I to dynamically generate different pics.
I really don't care HOW you get the different pics in there, but I want my stage to start out blank, so I think the only way to do it is with attachMovie. I have a zip file at: http://www.skycastleprod.com/demo/help.zip where you can see something I made. In that file, I generated a button with different url links that it will call when it is clicked, and it also has a textbox that displays different words for each box. The thing is, that file used ONE smartclip, and that's it. With one smartclip I was able to generate buttons with different URLs, and a textbox that has different sayings. WHY CAN'T I GENERATE DIFFERENT PICTURES?!?!?!?!?!? this is driving me insane. I've lost so much sleep coz of this, and it's not even part of a project. It's become more of a personal thing now #$%#$%@$. PLEASE HELP

Riki

AttachMovie
How come when using a attachmovie action, it works fine and the attached MC loads, but doesn't when I save the file and publish the settings.

.attachMovie=help
i'm trying to make an image slider, first i duplicate and move the movie clip by getting coordinates form a dragged empty mc, setting an inverse motion, so if the mouse goes up the mc and duplicated mcs go down. It all works very well, until i try to attach movies to the duplicated movie clips. Is this possible to do? can i attach movie clips(in this case each containing a picture) to duplicated ones??
thanks in advance.
supakoma

AttachMovie
I've got a little problem because i don't know the exact syntax for adressing targets in "attachMovie" or in general.

The problem is in these lines:




Code:
if (k<20) {
star1.attachMovie(star_mother, _root.anfang_ani["star"+k], k );
_root.anfang_ani["star"+k].speed = 15;

for (i=2; i<k; i++){
if(_root.anfang_ani[star1].diffy >= 1500 && _root.anfang_ani["star"+i].diffy >= 1000){
setProperty (_root.anfang_ani[star1], _visible, 0 );
setProperty (_root.anfang_ani["star"+i], _visible, 0 );
gotoAndPlay("start");
}
}
}

else{
gotoAndPlay("start");
}
It'd be extremely nice if somebody could take a look and remind me of the correct syntax or paths.

Thanks in advance

Using Mc.attachMovie() Without The Mc. -Don't Do It
I just spent a lot of time debugging a game for something really stupid I did and I learned something new about mc.attachMovie().

You can do this: attachMovie()
instead of
_root.attachMovie

Don't do it. Always include specifically the movie this new attached movie is attaching to, even if it is only the original root movie you are working within.

If you don't specify the MC parent that will own it, Flash 5 (I don't know about other versions) will assume the parent for you. You would think it would be what ever _root movie the script lies in but it is not always true. If you have attached other movies on the fly, it can pick up on another attached movie that is currently recieving events.

-Wade

AttachMovie
I have a movie clip called Circle_01 its placed on the main timeline.

I want to keep creating new instances of this but cant seem to even get one to work.

Here is the code im using???????????

_root.attachMovie("_root.Circle_01", "_root.Circle_2", 1);
_root.Circle_2._x = 150;
_root.Circle_2._y = 150;
_root.Circle_2._alpha = 1;
_root.Circle_2.play();

XML - AttachMovie - ._X
Hello, the code benith means: taking from an XML file information to present buttons on the stage:
the XML loads good and the information comes ok, and every thing works well till the part where i'm trying to place them on the screen (inside the loop "for" inside the "if" part).

this code should draw 2 lines of buttons - if for example there r 3 buttons, it will draw 2 one next to the other, and the third will be benith them.
The code does the attach movie but does not react to the commands mc._x , also inside the mc taken from the library by the attach command there are var which suppose to get thier values from the xml file - the values from the xml are loaded ok but i didn't manage to pass the values into this vars.

so it's 2 problems i'm dealing with.

(i can send the fla - it's light)

-----------------------------------------------------------
QuickSurfMenu = new XML();
QuickSurfMenu.load("QuickSurf.xml");
QuickSurfMenu.onLoad = DrawQuickSurf;

function DrawQuickSurf () {

QuickSurfMainMenu = new Array();
QuickSurfMainMenu = QuickSurfMenu.firstChild.childNodes; //The array QuickSurfMainMenu holds in it the "children"=firstLevel

var numOfChild = QuickSurfMainMenu.length;
var topButtons = Math.ceil(numOfChild/2); //upperButtons = the num of buttons at the top

var topButtonXlocation = 35; //this are the coordinates for the buttons at the top
var topButtonYlocation = 100;
var bottomButtonXlocation = 68; //this are the coordinates for the buttons at the bottom
var bottomButtonYlocation = 113;

for (var i=0; i < numOfChild; i++){
var ButtonInstName = "QS" + (i+1);
attachMovie("BackButton", ButtonInstName, i+1); //BackButton= BackButton from the library
this.ButtonInstName.caption = QuickSurfMenu.firstChild.childNodes[i].attributes.caption;
this.ButtonInstName.url = QuickSurfMenu.firstChild.childNodes[i].attributes.url;

if (i < topButtons){ //location of top button
topButtonXlocation = topButtonXlocation + 65;
this.ButtonInstName._x = 100; //topButtonXlocation;
this.ButtonInstName._y = topButtonYlocation;
} else { //location of bottom button
bottomButtonXlocation = bottomButtonXlocation + 65;
this.ButtonInstName._x = bottomButtonXlocation;
this.ButtonInstName._y = bottomButtonYlocation;
}
}
}

-----------------------------------------------------------
Thanks in advance,

Maya.

AttachMovie
Problem:

When I drag a movie clip onto _root and give it an instance name, the movieclip has no problem functioning when running the movie.

But if I attachMovie the same movie clip from the library and give it the same instance name as above, it no longer works. (this is what I want it to do). I am swapping in and out movie clips using the attachMovie function.

Why does it work when it is on _root from the start, and not when it is attached? The actionscript inside the movie clip is exactly the same.

AttachMovie()
Hi!
I have a problem attaching a Movie to a nested clip.
The clip's position( that i want to attach the movie to) is inside a clip that is masked.

If I try this in the main timline with the main movie : no problem.
inside this clip(name= _root.egg_movie.subnavigation) nothing is attached. I call the function from a previous attached movie(=Item) button.

the script:
snip:
xxxx
function ShowSubMenu () {
XPosition = eval("_root.Menu" add CurrentMenu)._x+56;
for (Counter=0; Counter<_root.Sub[0].Items.Length; Counter++) {
XPosition = XPosition;
attachMovie("Item", "Subs" add Counter, 300+Counter);
eval("Subs" add Counter).Name = _root.Sub[0].Items[Counter];
eval("Subs" add Counter)._x = 50;
eval("Subs" add Counter)._y = 50;
XPosition = XPosition+60;

}
}
xxxx
snip end
thankyou for your help! be m

AttachMovie()
Is it possible to attach a movie to another attached movie? like this:

myMovie.attachMovie("attach", "attme", 1);
attme.attachMovie("attach", "attme1", 2);

??

AttachMovie
ive tried this so many times but I can't seem to get it right. First i tried attaching a movie with a button

Code:
on (release) {
_root.target.attachMovie("a", "line", 5 );
}
that is the code i put but it doesn't work. iv'e tried this without the quotes too."a" is the MC in the library and "line" is what i want theinstance to be, target is an empty MC on the movie..i don't know why this won't woirk...can anyone help me please?¿?¿

AttachMovie
Hi guys,

I'm using attach movie like this:

_level0.attachMovie("exportName", "instanceName", 1);

however, the MC is visible throughout the movie, and I want it to only be visible on the frame that I create it on. Is there an easy way (without explicitly using unloadMovie when I leave the frame) to make it only appear on that frame?

cheers,

Darkwhiteorange

Help With Attachmovie
If I ma using attachmovie, i need 3 bits of info, the oldname, the new name and the level. With the new ID, can I reference it as an instance?

And If attach command was in a movieclip with instance name of nav would i refence the attached movies as _root.nav.newid ?

If any can help, I would really appreciate it.

AttachMovie Help?
Hey, all, hope somebody can help!

I'm using the code below to try and add a pic from the library with the linkage name "key". I want it to appear on the stage, and then pull out another 4, side-by-side. Unfortunately, this code doesn't seem to do anything...and I don't know why or what I should be doing!

Thanks in advance!

for(i=0; i<5; i++){
xStart = 100;
yStart = 100;
keyName = "key" + i;
_root.attachMovie("key", "key"+i, i);
_root[keyName]._x = xStart + 50;
_root[keyName]._y = yStart;
}

AttachMovie
can you attach a MC in an other MC from another MC?
i.e.

Code:
this[someMC].otherMC.attachMovie("Name",newName,1);
I can not get it to work, so either it's not possible,
or I'm doing something wrong.

BTW this.attachMovie(newName,1) works, so it isn't a error in the linkage part.

I also tried it with a function placed in 'otherMC '
Like...

Code:
function makeNewMC(newName,i) {
this.attachMovie("Name",newName,i);
}
I tried to call it from the root Like..
Like...

Code:
this[someMC].otherMC.makeNewMC("aName",1);
, but that also didn't work.

I realy need to attach a movieclip in 'otherMC' from outside 'otherMC' How can I do that?

Any help would be greatly appreciated,

[Edited by biker66 on 07-05-2002 at 07:30 PM]

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