Attach Movie Clip Instead Of External .jpg
I'm using the growTo Proto v1 script below written by Jesse Stratford and would like to attach a movie clip from the library instead of from an external file. I'm very new to actionscript and any help would be appreciated.
ActionScript Code: // Actions for buttonsbtn1_btn.onRelease = function() { loadThenGrow("images/fashion/fash_01.jpg");};btn2_btn.onRelease = function() { loadThenGrow("images/fashion/fash_02.jpg");};btn3_btn.onRelease = function() { loadThenGrow("images/fashion/fash_03.jpg");};btn4_btn.onRelease = function() { loadThenGrow("images/fashion/fash_04.jpg");};btn5_btn.onRelease = function() { loadThenGrow("images/fashion/fash_05.jpg");};btn6_btn.onRelease = function() { loadThenGrow("images/fashion/fash_06.jpg");};btn7_btn.onRelease = function() { loadThenGrow("images/fashion/image7.jpg");};btn8_btn.onRelease = function() { loadThenGrow("images/fashion/image8.jpg");};btn9_btn.onRelease = function() { loadThenGrow("images/fashion/image9.jpg");};btn10_btn.onRelease = function() { loadThenGrow("images/portraits/port_03_02.jpg");};// LoadTheGrow function takes a target image name.// Targets are hard-coded for the moment because I'm lazyfunction loadThenGrow(img) { bg_square_mc._parent.holder_mc.removeMovieClip(); bg_square_mc._parent.createEmptyMovieClip("holder_mc", 1); bg_square_mc._parent.holder_mc._visible = false; bg_square_mc._parent.holder_mc.onData = function() { if (this.getBytesLoaded() == this.getBytesTotal()) { this._visible = false; // Image fully loaded, grab dimensions and resize // background clip w = this._width; h = this._height; bg_square_mc.growTo(w+1, h+1, 10, _root.showHolder); } }; bg_square_mc._parent.holder_mc.loadMovie(img);}function showHolder() { w = bg_square_mc._parent.holder_mc._width; h = bg_square_mc._parent.holder_mc._height; bg_square_mc._parent.holder_mc._x = bg_square_mc._x-w/2; bg_square_mc._parent.holder_mc._y = bg_square_mc._y-h/2; bg_square_mc._parent.holder_mc._visible = true;}
Ultrashock Forums > Flash > Flash Newbie
Posted on: 2003-09-04
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Attach Clip Loaded From External .swf
Looking for a way to attach a movie clip (a few hundred instances)... the clip is imported in a .swf, that goes in to a few hundred dynamically created clips. I've tried a bunch of different duplication scenarios, etc. but havent found any good way to do it- other than loading the .swf in to each clip as they're duplicated.
Has anyone found a good way around this?
Remove Movie Clip And Attach Random Movie Clip
Hi: I am trying to create a mini game where there are pods of equations in which players must solve in order to make the pod disappear. Once a pod disappear a new one appears.
Attached is my .fla file so far- but I have been having trouble trying to remove movie clips once the player has solved the equation, and then attaching a random movie clip in the same location. I've been trying to use an if then statement but I'm not really sure? I also placed a removemovieclip at the end of a movieclip. I'm fairly new to actionscript.
So if anyone can help me with that I would really appreciate it. I am looking to finish this project in the next day or two!!
Thanks in advance.
Attach Movie Clip To Clip Linked In The Library
I am using Flash MX
I have a scrollbar component that is set as the scroller to another movieclip in the library that has a linkage name of "listing"
Now, what I would like to be able to do id use attachMovie() and attach other movieclips to that movieclip in the library. It's not actually attached to the stage, so is this even possible? It only has a linkage name.
Attach Movie Clip
Can someone explain to me how to use this code. I can't seem to get my button to do it.
on (press) {
ball.attachMovie( bounce, bounceball, 5 );
}
Is this right?
If so why won't it work
Thanks in advanced
Attach Movie Clip
Hi,
I'm presently attaching new movie clips to a already existing movie clip on the stage in Flash MX on user demand. The movie clips I'm attaching have buttons embedded in them that open a new browser window when pressed.
I've gotten the movie clips to attach, but have had limited sucess in actually activating the buttons on user demand. Any suggestions?
Attach MOVIE CLip
trying to attach a mc to the main time line everytime some on clicks onto the stage, this works how ever i want it to attach it to the last position where the mouse was clicked
got this code, it attaches the clip, but it just wacks it to the top
[code]
mousex = _root._xmouse
mousey = _root._ymouse
both =mousex && mousey
_root.attachMovie( "whole", "whole"+depth, depth++ )
Attach Movie Clip
code: onClipEvent(enterFrame){
if (this.hitTest(_root._xmouse, _root._ymouse) == true){
_root.mm.attachMovie("buttons", "buttons", 1)
_root.mm["buttons"]._x = _parent._x
_root.mm["buttons"]._y = _parent._y-50
}
}
I only want it to attach it once.
It is reattaching it everyframe while the hittest is still true.
Attach Movie Clip Help
Alright so im trying to attach 2 movie clips to the stage. Each to have a random location with the x and y properties between 0-400 using the math.random method any help would be appreciated. I shall attach a .fla thanks.
Attach Movie Clip
hey,
is there a way to attach a movie clip and make the object INVISIBLE (i.e. make the object's alpha 0 as it is attached).
here's the line of code to attach the clip:
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y: 35});
thanks!
-donkeyboy
Attach Movie Clip
I have a shooter kind of game
The character is throwing apples
if he hits some mc on the screen that Mc does something
My question when he misses how can I attach smoething where the apple has landed
--I remove the movie clip after its _y less than something
--I saw some tank games where when the terrain is hit the ground shows a hole in the place where the bullet lands
Any suggestions
I tried attach dead apple where the apple lands but the attached one goes all the way up in thescreen not where it supposed to be:
Code:
//this is the original apple
if( _root[n]._y>370 ){
trace("he is down");
var U = "deadfriend"+KC;
//this is the new apple
_root.attachMovie("deadfriend",U, KC);
_root[u]._x = _root[n].x;
_root[n].removeMovieClip();
_root.again.gotoAndStop(2);
KC++;
}
Thanks
Attach Movie Clip
I have a movie clip in my library we will call "MoveiclipA". In side MovieclipA i have another Movieclip we will call "MovieClipB". Its in my library and i use attachMovieClip with likage to bring it to the stage.
PHP Code:
attachMovieClip ("MovieClipA","MovieClip1",1)
MovieClipB will appear in the stage with MovieClipA but how do i call MovieclipB. For Example
PHP Code:
_root.MovieClip1.MovieClipB
will return nothing. Please help or ask me to clarify if you dont understand.
Thank You.
Attach Movie Clip
Please help on this question.. Thanks
Code:
var hands = new Array();
function attachHands(){
hand1.attachMovie("attachHand1","", 50);
hand2.attachMovie("attachHand2","", 50);
hand3.attachMovie("attachHand3","", 50);
hands.push(hand1);
hands.push(hand2);
hands.push(hand3);
}
These are the codes i have typed.
I have already attach the movie in hand1,hand2,hand3
Is there a way to remove attachHand1 and attach a new movie clip on it?
Not to overlap on attachHand1 because it will be seen.
Those hand1,hand2,hand3 are empty movie clips....
Thanks for reading the question >.<
Attach Movie Clip
Hi,
I was wondering if there's a way where you call out specific frame after attaching a movie clip.
Thanks for reading this post...
Attach Movie Clip With XML
Hello everybody!
Thats the first time i am using this forum so I'am a newbie. For first I must say that my english is the worst on earth. Therefore ask me please before you understood me.
My problem is:
I made the Attach Movie Clip with XML Load and it wondered me, because it worked.
But now I make Hover Captions inside the first Attach Movie Clip, also with an attach movie function, Now I have the problem how to get the data from the xml file into the 2. attach movie.
for the 1. path (into the first attach movie) the code looks like this.
_root["neuesMC"+i].xmlPfad = xmlDatei[i].attributes.namen;
Please tell me how to write the path into the second attach movie.
Thanks
my Structure:
> xml Load
> read XML
-> make 1st. attach Movie
--> make 2nd. attach Movie (onRollOver)
Help.. Attach Movie Clip
hey,
im kinda new with actionscripting, but im busy with a project for school.. makin something that kinda like an internet site.. but then just a load of text and picatures that need to be shown.. in a nice design etc for my teacher to read. I got about 15 different pages .. and need to make buttons for them etc ...and here comes my prob.
im gonna make each page apart (with the text and picatures) in different movieclips.. and each time i click on a button i need it to load that page... preferably with a fade in.. and fades out when u click on the next page.
thx if u reply
Dante
Help.. Attach Movie Clip
hey,
im kinda new with actionscripting, but im busy with a project for school.. makin something that kinda like an internet site.. but then just a load of text and picatures that need to be shown.. in a nice design etc for my teacher to read. I got about 15 different pages .. and need to make buttons for them etc ...and here comes my prob.
im gonna make each page apart (with the text and picatures) in different movieclips.. and each time i click on a button i need it to load that page... preferably with a fade in.. and fades out when u click on the next page.
thx if u reply
Dante
Attach Movie Clip
Please help on this question.. Thanks
Code:
var hands = new Array();
function attachHands(){
hand1.attachMovie("attachHand1","", 50);
hand2.attachMovie("attachHand2","", 50);
hand3.attachMovie("attachHand3","", 50);
hands.push(hand1);
hands.push(hand2);
hands.push(hand3);
}
These are the codes i have typed.
I have already attach the movie in hand1,hand2,hand3
Is there a way to remove attachHand1 and attach a new movie clip on it?
Not to overlap on attachHand1 because it will be seen.
Those hand1,hand2,hand3 are empty movie clips....
Thanks for reading the question >.<
Attach Movie Clip
Hi,
I was wondering if there's a way where you call out specific frame after attaching a movie clip.
Thanks for reading this post...
Attach Movie Clip
is there a way to attach a movie clip to the stage from the library in flash mx??
[AS] Attach Movie Clip
I made a var ----
ActionScript Code:
var event_mc:String = String("clip"+i+"_mc");
, than in a for loop i added this code so it attaches and duplicates a movie clip using linkage,
ActionScript Code:
attachMovie("event_mc", event_mc, i, { _ x: (i * 170)});
and it works it duplicates the dam mc on stage, but when I trace(event_mc); in my output window it says, clipundefined_mc what tha f**K is up with that. I am trying to trace it so i know if i can use it
ActionScript Code:
RIGHTHERE.dateText_mc.dateText.text = dateArray[i].firstChild.nodeValue;
so it attaches a new mc but understands the pathing for the info to feed into the xml file.
complete code.
ActionScript Code:
import mx.xpath.XPathAPI;
//
var events:XML = new XML();
events.ignoreWhite = true;
events.onLoad = function(success:Boolean) {
if (success) {
// Retrieve all names in the path wevents/Sunday/events/item/name.
var dateArray:Array = XPathAPI.selectNodeList(this.firstChild, "/wevents/Sunday/events/item/name");
var infoArray:Array = XPathAPI.selectNodeList(this.firstChild, "/wevents/Sunday/events/item/info");
var imageArray:Array = XPathAPI.selectNodeList(this.firstChild, "/wevents/Sunday/events/item/image");
//
var event_mc:String = String("clip"+i+"_mc");
//
var myX:Number = 175;
var myY:Number = 0;
for (var i:Number = 0; i<dateArray.length; i++) {
trace(dateArray[i].firstChild.nodeValue);
trace(infoArray[i].firstChild.nodeValue);
trace(imageArray[i].firstChild.nodeValue);
//attaches mc "event_mc" and renames it "event_mc1"
//attachMovie("event_mc", event_mc, i+10);
attachMovie("event_mc", event_mc, i, {_x:(i * 170)});
trace(event_mc);
//loads date and image
event_mc1.dateText_mc.dateText.text = dateArray[i].firstChild.nodeValue;
event_mc1.image_mc.image_mc2.loadMovie(imageArray[i].firstChild.nodeValue);
//
event_mc1._x = myX;
event_mc1._y = myY += (event_mc1.width)+2;
}
} else {
trace("XML loading failed !!!");
}
};
events.load("http://vaultultralounge.com/vault_cms/index.php?module=Xml&action=wevents");
//
Problem, Call Attach Movie From One Timeline To Another Movie Clip
Hi Everyone,
I have a relatively simple attachmovie problem.
I have have two different movie clip instances correctly labeled on the main _root timeline; "slider" and "projects_library". Inside the timeline of the "slider" clip is a script to attach a clip to the instance "projects_library". However when executed, it doesn't work. The script works fine if it runs on the _root timeline, but not when it's inside the "slider" timeline. I might have a misunderstanding of levels in my script. Hope someone can advise and clarify. Many thanks,
onEnterFrame = function () {
_root.projects_library.attachMovie("testproject", "testproject_new", _root.projects_library.getNextHighestDepth());
}
Attach Movie Clip Or Dublicate Movie Clip
Hi,
Im a bit new to flash actionscripting.
I would like to know the diffrence betwen dublicate move and Attach move and when do i use which method.
Could some one please point me in the right direction?
thank you for yout time and help.
Attach Movie Clip Question
I have a blank movie clip call ZoomBox
on a click event of a button I want to attach the MC Named MI. The code below will do this:
on (release) {
_root.ZoomBox.attachMovie("MI", "Mich", 1);
_root.ZoomBox.Mich._width = 500
_root.ZoomBox.Mich._Height = 500
_root.ZoomBox.Mich._x = -300
_root.ZoomBox.Mich._y = -450
_root.ZoomBox.Mich._rotation =10
}
When I click another button i want to load in a different MC how do I do this when I do not know when the second button is clicked what the current MC target path is?
How Do You A Attach Script To A Movie Clip?
sorry if this is a dumb question, but i've searched the forums and haven't been able to find an answer...
how do you attach actionscript to a movie clip?
I'm trying to control a volume fadeout of a an swf loaded into the main movie, and the tutorial says to attach the code to the movie clip (not the frame), and i can't figure it out. thanks for the help!
Help Needed With Attach Movie Clip.
Hi,
I'm working on a flash game and I'm having a big problem. The thing is I've created a part where the flash randomly chooses one of two movie clips and load them into an empty movieclip on the stage.
the empty clips instance name is empty and the code I use to attach is
num = random(2)+1;
if (num == 1){
empty.attachMovie("s1","empty",2);
}
if (num == 2){
empty.attachMovie("s2","empty",2);
}
then I made a button with this actionscript
on (release){
empty.play();
}
but the movieclip won't play. I've tried everything. Any help would be greatly appriciated.
Attach Movie Clip To End Of String
I want to attach a trademark symbol dynamically to the end of a button, which has a dynamic text field for a label. The registered character, ®, isn't displaying correctly in the font I am using, so I had to create a movie clip containg the character. I want to add it to the end of the string I'm passing into the dynamic text field. How is this done?
Thanks
Attach Movie Clip- The Question Is... How?
Alright heres wut i've got:
a movie clip of my "thing"
a 16x16 square, to be used as the "init_mc".. its CALLED "16x16"
the coordinates i want to place the thing on (16,16)
My code:
Code:
_root.cell[x], [y].attachMovie("NormalCell", "NormalCell[t],[y]", 2["16x16"]);
_root.cell[x], [y].moveTo((8*(x+1)), (8*(y+1)));
EXPLANATION: i have a script that will "create" my "things" (these are the only 2 lines of code i'm using, should i have an extra line of ".createemptymovieclip"???)
and i want them to be placed depending on wut their value is...
for example, my program evaluates that "3,2" is a solution, so i want it to place my "thing" with the properties of my 16x16 square at 32, 24, and call it (for further call-up reference) cell3,2 in the _root. directory. So, it will resize my "thing" to 16x16 pixels, and move it to 32, 24 (does that make sense?) in the end i want a program that will:
1: create a never ending supply of "things"
and
2: place them depending on their "id"...
The error is coming in when its creating the movie clip.. i think its a syntax thing, but i'm not actually getting an error message... so the syntax is right, its a value thats wrong... PLEASE REPLY VERY VERY SOON!!!
How To Attach Button Cmd To Movie Clip?
I'm Using Flash8-
Whats wrong with this script? Please HELP!
on (rollOver) {
_root.text = _name;
tellTarget ("lable") {
gotoAndPlay(2);
}
}
on (rollOut) {
tellTarget ("lable") {
gotoAndPlay(16);
}
}
on (release) {
_root.gotoAndStop(2);
}
Attach Movie Clip? - FAST HELP. Thank You
[FLASH 8]
Hey, I need help with somthing please :
How do you get this to work when it's with in a function?
Example:
Code:
function c1sectionadd() {
this.attachMovie("NF02", "move03", 395, {_x:12.2, _y:603.6});
this.attachMovie("NTtrees01", "move11", 397, {_x:12.9, _y:521.8});
this.attachMovie("WB01", "move10", 4, {_x:-6.0, _y:608.0});
clearInterval(sectionadd);
}
And it is being called from:
Code:
onClipEvent (enterFrame) {
if (this.hitTest(_parent.player.hit)) {
if (addc1mc != false) {
_parent.sectionadd = setInterval(_parent.c1sectionadd, 100);
addc1mc = false;
}
}
}
The above code is in a movieclip's actions, it's located directly on the stage.
Thanks to all who respond
[F8] Attach Movie Clip PROBLEM
on my root i have a Movie clip container in which i load other movie clips using
attach movie clip
example:(_root.container.attachMovie("storitveMC","storitv eMC",this.getNextHighestDepth());
storitve MC has a 10 frame timeline
from frame 1 to 5 alpha changes from 0% to 100% and stops
and from frame 5 to 10 alpha goes form 100% to 0 % and stops
then, i load another movie clip in the same container(attachMovie)... but
i cant get the movie clip that was inside container before to play from 5 to 10!
becouse attachMovie just emptyes the container and loads another movie clip inside.
So if u can help me, HOW CAN I ATTACH ANOTHER MOVIE INTO A CONTAINER BUT FIRST (fade out alpha from 100% to 0%) from the movie clip that is already inside..?
This is a page that does what i want: (when u click on button -pictures on the left)!!!
http://www.finerdesign.com/website-templates/template-16199.html
please help!
thanks
Attach Movie That Is Already Created To Another Clip
Is it possible to attach a movie clip to another clip that has already been created. For example...
ActionScript Code:
_Image = top.attachMovie(image, "img" + depth, depth+1);
top._x = 200;
top._y = 200;
trace(_Image._x + " " + _Image._y); // outputs "0 0"
Is there a way to take a movie that has already been loaded an isn't in the library and attach it to another in the same manor? So that it's origin when at (0,0) would be the current top position? Thanks.
Attach More Than 1 Movie Clip From 1 Class
hi what im trying to do is attach two movie clips from a class.
PHP Code:
class work {
public function work() {
_root.attachMovie("work", "tri", 0);
_root.tri._x = 0;
_root.tri._y = 0;
}
public function button() {
_root.attachMovie("button", "but1", 1);
_root.but1._x = 520;
_root.but1._y = 80;
}
}
the first method works but the second one does nothing can anyone please help thanks
Depth With Attach Movie Clip
im having problems with attach movie clip. Ill attach a movie clip to a second movie clip.
PHP Code:
attachMovie ("imageA","imgA",1)
_root.imgA.attachMovie ("imageB","imgB",0)
for some reason imgB well appear above imgA and ive tried a few things like even swapping depths after ive made them. I would like to have imgA above imgB. Please and Thank You.
Attach Movie Clip To ScrollPane
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in the scrollPane
Can any one suggest me , how can I do this
Thank you very much
Attach Movie Clip Stuff
first id like to say that i have very little idea what im talking about.
hmmmmmm.... ive been having problems with my actionscripting.
i want a movieclip to be attached to another one when a key is pressed. i thought something like this would work:
onClipEvent (enterFrame) {
if (key.isdown(key.SPACE)) {
clip1.attachMovie("clip2", "clip2newname", 10);
}
}
where "clip2" is the linkage identifier for the mc to be attached. the code is placed on the outside of the clip one, where i want clip2 to go.
the attachmovie method works on its own, but not with the if condition.
any help is appreciated
Attach Sound To A Movie Clip.
As the title states, I would like to attach a sound to a movie clip that is serving as a button.
I want the movie clip button to make a little noise when the mouse rollovers it.
I am using Flash MX.
Thank you in advance for any help.
Attach Movie Clip Stuff
first id like to say that i have very little idea what im talking about.
hmmmmmm.... ive been having problems with my actionscripting.
i want a movieclip to be attached to another one when a key is pressed. i thought something like this would work:
onClipEvent (enterFrame) {
if (key.isdown(key.SPACE)) {
clip1.attachMovie("clip2", "clip2newname", 10);
}
}
where "clip2" is the linkage identifier for the mc to be attached. the code is placed on the outside of the clip one, where i want clip2 to go.
the attachmovie method works on its own, but not with the if condition.
any help is appreciated
Attach Sound To Movie Clip
Guys I have a movie clip that glides into place over the top of a button when the button is moused over. I'm trying to get a sound to play but only when the clip comes to a stop over the button. All works fine except the sound won't play. I have code that controls the slide on the time line and the button but i wont post that as there probably is no need.
When the clip loads I attach the sound, on mouse over i play the sound. But it doesnt work...Any Ideas what im doing wrong?
CODEonClipEvent (load) {
xMove = _x;
easeSpeed = 5;
//load sound
var my_bleep:Sound = new Sound();
my_bleep.attachSound("bleep");
}
onClipEvent (enterFrame) {
_x += (xMove-_x)/easeSpeed;
}
onClipEvent (mouseUp) {
my_bleep.start();
}
How Do You Attach And Play A Movie Clip To A Movie Object?
I have a movie clip in my library, and i want to use action script to play the clip on my scene1 stage. I know i can simply drag the clip on the stage, but solving this will make most of my other problems dissappear.
I tried in the first frame of my scene:
---------------------------------------
mymovie = new MovieClip();
mymovie.attchMovie(clip,clip,20);
mymovie.play();
---------------------------------------
but it did not work...help! :-)
any suggestions?
zavyzavy
Duplicate And Attach Movie Within Another Movie Clip Problem
I'm having problems duplicating/attaching movie clips within a movie clip.
I have a panel_MC on stage. I want to be able to dynamically attach several movie clips (essentially they will be buttons) into this panel_MC. Unfortunately when I use mc.attachMovie() the previous movie clips are overridden..
here is some of my code.
Code:
var noOfIcons:Number = 10; /* 10 for easiness sake.. real number will be determined by a function */
var iconBtnXPos:Number = 0;
for (i=1; i<noOfIcons;i++){
var btnNo:Number = i;
panel.createEmptyMovieClip("container"+btnNo,this.getNextHighestDepth());
whereIsThis = panel["container"+btnNo].attachMovie("iconButton","icon"+btnNo, this.getNextHighestDepth());
trace("whereIsThis :"+ whereIsThis);
this.panel["container"+btnNo]["icon"+btnNo].iconLabel.iconText.text = btnNo;
this.panel["container"+btnNo]._x = iconBtnXPos;
this.panel["container"+btnNo]["icon"+btnNo].onRelease = iconBtnRelease;
iconBtnXPos +=52;//calculate next _x button position
}
Any ideas?
How Can I Attach A Movie Clip, Move It Across The Ge, Then Remove It?
I have a Flash movie with one scene. In Frame 20, I want to attach a movie clip at (272, 116). In Frame 34, I want it to have moved down to (272, 232). In Frame 35, I want it to disappear.
I understand using AttachMovie and RemoveMovieClip, but how can I get that movie clip to move across the stage before being removed?
Attach Caption To Resizing Movie Clip
I am trying to attach a "caption" to the bottom right edge of a movie clip
that resizes. I am using the resizing clip as a image holder for a gallery.
The resizing clip is in a movieclip within another movie clip that is on the
main stage. The resizing clip has two clips within it: one named "container"
and one named "the_border". The clip I am trying to position at the bottom
right is named "numbers".
I have tried "attachMovie" in many permutations to no avail. I saw the code
"attachClip" in another gallery once but I cannot find documentatiopn of how
to use it.
Here is the code I have so far:
******
spacing = 1;
number_spacing=10;
_root.gallery.screenshots.container._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
_root.gallery.screenshots.container._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function() {
var t = _root.gallery.screenshots.container.getBytesTotal( ), l =
_root.gallery.screenshots.container.getBytesLoaded ();
if (t != 0 && Math.round(l/t) == 1 &&
_root.gallery.screenshots.container._width != 0) {
var w = _root.gallery.screenshots.container._width+spacing , h =
_root.gallery.screenshots.container._height+spacin g;
_root.gallery.screenshots.the_border.resizeMe(w, h);
delete _root.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
_root.gallery.screenshots.container._x = this._x - this._width/2 +
spacing/2;
_root.gallery.screenshots.container._y = this._y - this._height/2 +
spacing/2;
_root.gallery.screenshots.container._alpha = 100;
delete this.onEnterFrame;
}
}
};
_root.gallery.screenshots.container.loadPic("image s/michelob_page2.jpg");
***
Please help.
Thanks,
oohah
[flash 8] Attach Movie Clip Help Requested
I have decided to ditch the duplicate movie clip function and have moved on to attach movie clip for a game.
This is on my first frame:code:
_global.init = function() {
firstMC = 1;
lastMC = 0;
totalMC = 10;
timeSinceLastMC = 0;
}
_global.newMC = function(){
//only add new MC if it has been long enough
//try changing this value to determine how soon MCs appear
if (timeSinceLastMC > 12){
//check if there are still more MCs
if (lastMC < totalMC){
//only add 50% of the time
if (Math.random() <.5){
//create new MC and set its location
lastMC++;
attachMovie ("demon_mc","demon_mc"+lastMC,lastMC);
//also set MC location to right of stage and height adjusted to within the stage
_root["demon_mc"+lastMC]._x = Math.random()*500 + Stage.width;
_root["demon_mc"+lastMC]._y = Math.random()*250 + 10;
//reset time since lastMC
timeSinceLastMC = 0;
}
}
}
timeSinceLastMC++;
}
_global.moveMC = function(){
//loop through all available MCs
for (i=firstMC; i<=lastMC; i++){
//get the x location
x = _root["demon_mc"+i]._x;
//move the x location
_root["demon_mc"+i]._x = x - 10;
}
}
And I have a movie clip calling the functions:
code:
onClipEvent(load){
_global.init();
}
onClipEvent(enterFrame){
_global.newMC();
_global.moveMC();
}
My question is - how do I still get the "demon_mc" to detect a hitTest?
Convert Or Attach Thumbnails To Movie Clip
i have an idea of what i want done, but can't really get the method down. i am trying to import thumnails through xml and convert each one to a different movie clip.
i have the xml pulling in thumbnails working, which is great!!! what i need is for each thumbnail to be placed inside (or attached to) a different movie clip and be given a different name. i am having trouble with the math portion of this.
not sure if i am on the right track with this idea or not, but i need something that calls in the thumbnails, converts (or attaches) to a movie clip, then gives it a unique name (like: "movieclip_01"), then loops and changes the name (movieclip_02, movieclip_03, _04...) each time. does this make sense? have i gone crazy? hmmm...
Attach A Movie To A Dynamicly Created Clip
I was wondering the syntax for how to dynamically create name to attach a method statement to (I probably said that totally wrong, I haven't got all the terminology yet). This is a sample of what I have so far (the underlined part is where I need the help):
Code:
timer = timer + 1
if (timer = 20)
{
set =+ 1;
createEmptyMovieClip("laser1"+set,getNextHighestDepth());
lname = "laser1"+set;
_root.(laser1+set).attachMovie(laser1,"laser1",_root.(laser1+set).getNextHighestDepth());
timer = 0
}
This problem has probably been answered before but I don't know the words to use to search for the answer. So if you could answer it again or even direct me to another thread or tut it would be of great help. Thanks in advance.
P.S. How do you create an actionscript code box?
|