AttachMovie And OnRelease Dosnt Work
Hi,
i am new to mx.
I am trying to build my own photo album.
i have a large stage, and a blank mc to load my images into.
i get a list of images from my server, then loop over that list and
attachMovie("blank_mc","image_mc"+i);
then i scale the image to like 10.
i want the image to scale back to 100 with easing when the image is clicked.
i have tried several different ways to attach the blank mc load the image and build a onRelease function for each blank_mc. but nothing seems to work. the only way i have gotten it to do anything close is to createEmptyMovieClip() on the root then attach my blank to the that, then i can put my onRelease on the target_mc not the blank_mc. But i cant tell which image was clicked.
Please help
thanks
heres my creation code:
Code:
for (var i = 0; i"<"tmpArray.length; i++) {
var tmpmc:MovieClip;
tmpmc =_root.target_mc.attachMovie("picmc","pic_mc"+i,_root.getNextHighestDepth()+i,{gID:i});
//this dosnt work here:
tmpmc.onRelease = function (){
expand_mc(tmpmc.gID);//function to move the image around and scale.
};
tmpmc._xscale = 12;
tmpmc._yscale = 12;
}
FlashKit > Flash Help > Flash MX
Posted on: 08-24-2005, 03:10 AM
View Complete Forum Thread with Replies
Sponsored Links:
Still Dosnt Work?
thanx,but still it dosnt work
::::::
on (release)
{ loadVariablesNum ("ransquiz.txt", 0);
my = _root.rq1; ---(rqi is the variable from text file)-
if (my ==_root.answer)-----(answer is the inputtext box)--
{tellTarget (_root.result)
{ gotoAndStop (2);
}
}
}
:::::::::
I tried asigning values from text variable to another variable then comparing, i can see both the variables 'my' and 'answer' but when the relational statement IF dosnt work ?totally surprised!!!!
View Replies !
View Related
Autorun Dosnt Work?
i am making a cdrom in which i have a starting full screen(fscomand fullscreen) flash projector file(cd.exe) which i want to launch.i put a AUTORUN.INF file in which i write:::
[autorun]
OPEN=CD.EXE /AUTORUN
When i put the cd a blank flash window opens but not the cd.exe. Otherwise on double clicking the file it runs properly. Why?
View Replies !
View Related
Movieclip..it Dosnt Work Properly
onClipEvent (enterFrame) {
Mouse = _xmouse;
if (mouse<0)
{
Mouse = -1*mouse;
}
scale = 200-mouse;
if (scale<100)
{
scale = 100;
}
if (scale>200)
{
scale = 200;
}
setProperty ("", _yscale, scale);
}
is the code im using but if i ad a
this.onPress = gotoAndPlay(2); its wierd...ude have to see what i mean...but it dosent work....if u want to help me ill send u the fla can u tell me wats wrong...anyone
View Replies !
View Related
Swedish Signs Dosnt Work, Why ?
Hi every1.
i have a problem, again.
I have posted at the General flash gelp but the help i got ther didint help, so i'll try here.
I have a dynamic textbox witch i have some code in, i have a wordpad document with some text in, and it loads in the textbox.
But now i have this problem, when i publish the browser wont load swedish signs like Å,Ä and Ö. Why is that
i have checked the charahter options.
All charachters
i have tryed only lowecase uppercase, numerials, "and these characters"= ÅÄÖ
What am i doing wrong ?
I am using the font ARIAL witch includes the characters ÅÄÖ
An just for case i changed the font to arial in the wordpad document, witch shouldn have any effect relly...
What am i doing wroooongg ??
View Replies !
View Related
AttachMovie + OnRelease
Here my code ... when trace the imagem Array into for work fine.. but when put it into onRelease not work..
ActionScript Code:
var plevel:Number = 1000;var xdata:XML = new XML();xdata.ignoreWhite = true;xdata.load("dados.xml");xdata.onLoad = function() { var pqt:Number = xdata.childNodes[0].childNodes.length; var imagem:Array = []; for ( pqn=0; pqn<pqt; pqn++ ) { var peca:MovieClip = attachMovie("c_clip","clip"+pqn,plevel++); var pnom:String = xdata.childNodes[0].childNodes[pqn].childNodes[0].firstChild; imagem[pqn] = xdata.childNodes[0].childNodes[pqn].childNodes[1].firstChild; peca.nome.autoSize = "center"; peca.nome.text = pnom; peca._x = (110*pqn)+10; peca._y = 10; trace(imagem[pqn]); peca.onRelease = function() { trace(imagem[pqn]); } }}
Anyideas ... need help!
Rename the 'dados.xml.txt' for dados.xml
View Replies !
View Related
Onrelease/attachmovie Problem
attaching and clicking on the movie clips in the following code works. However. the trace in the onRelease function only shows me what is in the last array record in this case "the third string" no matter which movie I click .
Can anyone show me the correct way?
ActionScript Code:
*******************moving_var = 0;text_placement = 1;my_array = array();my_array[0] = "the first string";my_array[1] = "the second string";my_array[2] = "the third string";while (moving_var < 5) { _root.attachMovie("state_text_mv", "state_list" + [moving_var], moving_var); _root["state_list" + [moving_var]].state_text.text = my_array[moving_var]; _root["state_list" + [moving_var]].onRelease = function() { trace(my_array[moving_var]); }; moving_var++;}
*******************
thanks
View Replies !
View Related
AttachMovie + OnRelease - The Problem
Here my problem:
i created a site in flash and xml that has one photo gallery with link in photos.
when click in photos may load the large photo. Right. but now when i click in some photo load the same large image, load the ultimate large image from xml file.
ActionScript Code:
_global.path = "";var plevel:Number = 1000;for (i=0; i<20; i++) { var peca:MovieClip = attachMovie("gal","gal"+i,plevel++); var fotog:String = xdata.childNodes[0].childNodes[i].childNodes[0].firstChild; var fotol:String = xdata.childNodes[0].childNodes[i].childNodes[1].firstChild; peca.loadMovie(_global.path + fotog); peca._x = 120*i; peca._y = 130*i; peca.onRelease = function() { largph.loadMovie(_global.path + fotol); // here load only ultimate node of xml }}
Anyone know how to do it ? load independent large images ...
Tks Guys!
View Replies !
View Related
Onrelease/attachmovie Problem
attaching and clicking on the movie clips in the following code works. However. the trace in the onRelease function only shows me what is in the last array record in this case "the third string" no matter which movie I click .
Can anyone show me the correct way?
ActionScript Code:
*******************moving_var = 0;text_placement = 1;my_array = array();my_array[0] = "the first string";my_array[1] = "the second string";my_array[2] = "the third string";while (moving_var < 5) { _root.attachMovie("state_text_mv", "state_list" + [moving_var], moving_var); _root["state_list" + [moving_var]].state_text.text = my_array[moving_var]; _root["state_list" + [moving_var]].onRelease = function() { trace(my_array[moving_var]); }; moving_var++;}
*******************
thanks
View Replies !
View Related
Can't Get 'mc.onRelease' To Work
Hi
I want to be able to do something when I click my large image (which is placed inside the mc image). The thumb.onRelease works, and when I click on it, a large image appears. But I want to be able to click on that image too! How can I do that? Here's my code:
ActionScript Code:
function loadThumb() { for (i=0; i<size; i++) { var thumb = this.createEmptyMovieClip("thumbnail"+i, i); thumb.holder = thumb.createEmptyMovieClip("holder", 1); thumb._x = i*50; thumb.pic = imgFolder+imgArray[i]; makeThumb(thumb.holder, thumb.pic, i); thumb.onRelease = function() { var image = _root.createEmptyMovieClip("image", 1500+i); image.holder = image.createEmptyMovieClip("holder", 1); image._x = image._y = 50; image.holder = image.loadMovie(this.pic); image.onRelease = function(){ trace("Pressed large image"); }; }; }}function makeThumb(th, pic, depth) { th.loadMovie(pic); var temp = this.createEmptyMovieClip("temp", 999+depth); temp.onEnterFrame = function() { if (th._width>0 && th._height>0 && th.getBytesLoaded()==th.getBytesTotal()) { //layer 'preloader' imgLoaded("add"); th._width = 50; th._height = 50; delete this.onEnterFrame; } };}
regards, henxon
View Replies !
View Related
Can't Get 'mc.onRelease' To Work
Hi
I want to be able to do something when I click my large image (which is placed inside the mc image). The thumb.onRelease works, and when I click on it, a large image appears. But I want to be able to click on that image too! How can I do that? Here's my code:
ActionScript Code:
function loadThumb() { for (i=0; i<size; i++) { var thumb = this.createEmptyMovieClip("thumbnail"+i, i); thumb.holder = thumb.createEmptyMovieClip("holder", 1); thumb._x = i*50; thumb.pic = imgFolder+imgArray[i]; makeThumb(thumb.holder, thumb.pic, i); thumb.onRelease = function() { var image = _root.createEmptyMovieClip("image", 1500+i); image.holder = image.createEmptyMovieClip("holder", 1); image._x = image._y = 50; image.holder = image.loadMovie(this.pic); image.onRelease = function(){ trace("Pressed large image"); }; }; }}function makeThumb(th, pic, depth) { th.loadMovie(pic); var temp = this.createEmptyMovieClip("temp", 999+depth); temp.onEnterFrame = function() { if (th._width>0 && th._height>0 && th.getBytesLoaded()==th.getBytesTotal()) { //layer 'preloader' imgLoaded("add"); th._width = 50; th._height = 50; delete this.onEnterFrame; } };}
regards, henxon
View Replies !
View Related
OnRelease Doesn't Work
Hello,
a week ago, I posted a problem that I had with the onRelease-event.
Because I'm still having the same problem I started to delete all items from my movie to find out what problem I'm dealing with.
Now I have a blank stage, 1 mc, and 4 lines of code, and it still doesn't work.
When I start a new project, and use the same lines of code, the mc-button works perfect, but in the current project it doesn't.
Does anyone know what I do need to change at my project to make those line of code work?
http://download.beuntje.com/menu.fla
thanks, Benedikt
View Replies !
View Related
Multiple Functions Will Not Work Onrelease
Hello! I'm trying to put a portfolio together. I've got all the links working except I thought it would be a good idea to use the component loader to show the pictures. When I click on the button "biaalfa", i set a frame action to go to frame 41 or frame "iaalfa". Flash does this fine, but the pic "Aa1.jpg" that my loader is supposed to load, does not until I click on the button a second time. What am I doing wrong? Thanks.
this.biaalfa.onRelease = function() {
myLoader.contentPath = "Aa1.jpg";
gotoAndStop("iaalfa");
}
View Replies !
View Related
(easy Solve?) Can't Get OnRelease To Work
OK last one I promise.
Basically the colored type in the code below is wrong, and I don't know how to fix it. I KNOW the red doesn't work, but since I've never gotten far enough for the blue part to execute, I can only ASSUME it's wrong because nothing has worked for me yet.
So here's the deal. I need to red part to point to one of the 1-5 "title" variables similar to this code (which works):
this["aud"+i]["aud"+i+"List"].text = this["aud"+i+"ListName"];
using "this" doesn't seem to work inside of a function.
And I need the blue part to point to one of the 1-5 "file" variables.
Code:
var aud1Title = "title1";
var aud2Title = "title2";
var aud3Title = "title3";
var aud4Title = "title4";
var aud5Title = "title5";
//
var aud1File = "file1.flv";
var aud2File = "file2.flv";
var aud3File = "file3.flv";
var aud4File = "file4.flv";
var aud5File = "file5.flv";
//
var aud1ListName = "hammer1";
var aud2ListName = "hammer2";
var aud3ListName = "hammer3";
var aud4ListName = "hammer4";
var aud5ListName = "hammer5";
//
//----THE FOLLOWING CODE WORKS, SO DON'T WORRY ABOUT IT-------
for (i=1; i<=5; i++) {
this["aud"+i]["aud"+i+"List"].text = this["aud"+i+"ListName"];
//
this["aud"+i].onRollOver = function() {
var color = new Color(this);
color.setRGB(0xFF0000);
};
this["aud"+i].onRollOut = function() {
var color = new Color(this);
color.setRGB(0xFFFFFF);
};
//----BELOW IS WHERE THE PROBLEM IS-------------------------
this["aud"+i].onRelease = function() {
nowplaying.text = this["aud"+i+"Title"];
_root.vidPlayer.setMedia("aud"+i+"File", "FLV");
};
}
stop();
Thanks for the help
View Replies !
View Related
Beginner OnRelease Button Doesn't Work
please download my .fla file at (where you can also learn from (design and structure))
http://www.fzvastgoed.nl/pcxpert/michaellobry.zip
1 open frame_buttons.fla
2 go to Action panel of: frame 1 Main Timeline, layer: a.
3 this code:
PHP Code:
_root.onMouseDown, _root.onDragOut, _root.onMouseUp, _root.onPress, _root.onRelease, _root.onReleaseOutside=function () {
trace("pleaseclickhere");
this.pleaseClickHere_mc.removeMovieClip();
};
doesn't work, why? What it must do is: when onPress, onRelease en onReleaseOutside, then pleaseClickHere_mc movieclip must never be played again and never be seen again.
i tried every path like:
global.onPress and super.onPress
in vain
question 2:
All buttons in the movieClips:
settings_mc, searchBar_mc and homepage_mc (then go to the last frame within that MC where the buttons are), don't work. How come?, since the given path is correct, eg:
PHP Code:
this.close_btn.onPress = function() {
this.gotoAndStop(1);
};
View Replies !
View Related
OnRelease = Function() // Recursive Assignment Does Not Work
Hi
there does anybody know why the following can not be turned into a simple loop with for () or while () ?
Help would be appreciated!
Thanks! ;-) Joc.
ActionScript Code:
//
//
this.meal0.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[0];
};
this.meal1.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[1];
};
this.meal2.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[2];
};
this.meal3.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[3];
};
this.meal4.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[4];
};
this.meal5.meal_M_bg.onRelease = function() {
_root.mealsAcr.text = mealsAcrArray[5];
};
//
//
View Replies !
View Related
OnRelease Does Not Work When Loading External JPEG?
I want to display several thumbnails, each loaded as an external jpeg. When clicked, I want the thumbnail to launch into a video.
I am running into a problem after loading the thumbnail images. The onRelease method no longer works. However, if I leave out the loadMovie line, the onRelease method does work for the image holders.
Code:
// creates the empty movie clip to hold the thumbnails
_root.createEmptyMovieClip("thumbs", 200);
for(i=0; i<videoData.length; i++)
{
// attaches a movie instance for the image holder
var curThumb = thumbs.attachMovie("thumbnailHolder", "thumbnail_"+i, 300-i);
curThumb._x = 90*i;
curThumb.id = i;
curThumb.loadMovie(videoData[i].thumbnail);
// this does not work if the loadMovie method is used
curThumb.onRelease = function()
{
launchThumb(this);
}
}
Can anyone help me understand why this is happening? Thanks!
View Replies !
View Related
Why Doesn't This Script Work With OnRollover When It Works With OnRelease?
I need a rollover function and so I changed onRelease to onRollover but the rollover effect then doesn't work. Can't fugure out why. Please help.
- Script is on seperate layer (on root)
- hit_mc is the movie clip on which the rollover should work
- mask_mc is the one that should tween when mouse goes over hit_mc
hit_mc.onRollover = function() {
tweenBall(mx.transitions.easing.Regular.easeOut);
};
function tweenBall(easeType) {
var begin = 17;
var end = 200;
var time = 15;
var mc = mask_mc;
ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
View Replies !
View Related
Changing OnRelease To OnRollover Doesn't Work In This Script
I need a rollover function and so I changed onRelease to onRollover but the rollover effect then doesn't work. Can't fugure out why. Please help.
- Script is on seperate layer (on root)
- hit_mc is the movie clip on which the rollover should work
- mask_mc is the one that should tween when mouse goes over hit_mc
hit_mc.onRollover = function() {
tweenBall(mx.transitions.easing.Regular.easeOut);
};
function tweenBall(easeType) {
var begin = 17;
var end = 200;
var time = 15;
var mc = mask_mc;
ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
View Replies !
View Related
Changing OnRelease To OnRollover Doesn't Work In This Script
I need a rollover function and so I changed onRelease to onRollover but the rollover effect then doesn't work. Can't fugure out why. Please help.
- Script is on seperate layer (on root)
- hit_mc is the movie clip on which the rollover should work
- mask_mc is the one that should tween when mouse goes over hit_mc
hit_mc.onRollover = function() {
tweenBall(mx.transitions.easing.Regular.easeOut);
};
function tweenBall(easeType) {
var begin = 17;
var end = 200;
var time = 15;
var mc = mask_mc;
ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
View Replies !
View Related
If A Input Text Box Dosnt Have Anything In It
what i am trying to do is this
I have 8 input boxes and 8 Dynamic Boxes
the 8 Input boxes is A-G and the dynamic boxes are A1-G1
Right now i have the code setup to calculate whats in the input boxes and display the results in the dynamic boxes but what i need is if the input boxes are left blank the answer taht goes in that input box will be in teh dynamic box.. get what i am saying?
basically
value1=A
value2=b
value3=C
value9 = Number(value2)+Number(value3)
A1=value9
what i need to do is if A isnt filled in it does this equation but dosnt display anything in the input box (like NaN or 0)
any help would be nice
thanks
Jonathan
[Edited by jonathanc on 03-19-2002 at 11:43 PM]
View Replies !
View Related
Score, Dosnt Increment On Collision ?
i am making a small game kind of a thing,where on a click of a button a MC starts playing(a ball jumping),i have another MC(a ship maving across the screen).
Now i want to increment the score,a Variable,on every colision.Every thing is fine i.e,i get the true/false value from the hitTest,but the score dosnt increment on collision instead it satrs all of a sudden and the value starts incrementing endlessly.i have put the fallowing code in the 2nd keyframe of the movie(total frames=2)
----------
score = Number (score) + (s);
if (status==true){
s = "1";
}
----------
*Collision detection is working fine as i can see it in a dynamic text window.
View Replies !
View Related
How Does Attachmovie Work?
this is what I understand...
MovieClip.(idName,NewName,depth)
for example:
(object the Library movie clip is being loaded to).(idName,NewName,depth)
I do not know what the rest of it really means, like the difference between idName and NewName, or where to enter some of these values, other than "linkage properties". Help?
View Replies !
View Related
AttachMovie From Loaded .swf Does Not Work
According to one tutorial I made a movie which load pictures as a separate clips from another movie library.swf. The script si simple:
placeHolder.loadMovie("library.swf");
if (Number(_framesloaded)>=Number(_totalframes)) {
gotoAndPlay (3);
}
loads the library movie and waits until its loaded.
Then there si something like this:
placeHolder.attachMovie("obr1", "myobr1", 1);
placeHolder.myobr1._x = -121;
placeHolder.myobr1._y = -70;
To attach clips to specific position.
The problem is, that it works perfectly on my local machine (and it does not matter, whether I acces the movie directly or via internet server), but when I place it to remote web server, to external clips simply do not appear.
Does anybody have an idea, where the problem might be?
Thanks for any help!
View Replies !
View Related
AttachMovie - Why This Script Does Not Work?
How do I get this script to run:
for (i=0; i<10; i++) {
_root.attachMovie("testfilm", "testfilm"+i, "i");
_root.testfilm+i._x=10*i;
_root.testfilm+i._y=10*i;
}
What do I want to do:
In the first frame of the _root-Movieclip shall be loaded 10 movieclipinstances with a different position each.
View Replies !
View Related
Why Attachmovie Won't Work With Root MC
Ok, it's like this - I was working a case on downtown lower east uptown northwest by the shoreline at the docks upstate, when in walks this dame; well, I say dame but I don't just mean any dame etc. etc.
What I mean is: how can I use attachmovie so that it's recognised by my preloader logic?
I've set the linkage so MC in library doesn't Export On First Frame so that preloader should preload.
I've also created an MC on the root with the attachmovie AS.
Does this work?
No - it does not.
It simply will not attach my library MC to the onstage MC.
Doh.
Can anybody advise me please as I would love to crack this.
Regards
Yan
View Replies !
View Related
Buttons Won't Work When Using AttachMovie
I'm adding a bunch of buttons to a movie using attachMovie, but they won't work no matter what.
Here's the code:
Code:
_root.gallery_mc.q.attachMovie("hit", "thumbButton" + i, _root.gallery_mc.q.getNextHighestDepth());
_root.gallery_mc.q["thumbButton" + i].onRelease = function() {
trace("It works.");
}
Note: The variable, "i", is defined. It is in a for loop which I have not included in my code.
I can see the buttons on stage, but nothing happens when I click them.
Any ideas on why nothing happens when I click the buttons?
Thanks,
Brendan Benson
View Replies !
View Related
Why Doesn't AttachMovie Work?
ok here is my code:
ActionScript Code:
var holder:MovieClip = mc_room.foreground_mc;
holder.attachMovie("testclip", "avatar_" + smartfox.myUserId,
holder.getNextHighestDepth());
trace (holder) //outputs: _level0.mc_room.foreground_mc
trace ("avatar_" + smartfox.myUserId); //outputs: avatar_14
myAvatar = holder["avatar_" + smartfox.myUserId];
trace (holder._x + ", " + holder._y); //outputs: 381.5, 347.5
trace (myAvatar); //outputs: undefined
There is a clip called test clip in the library and if I attach it to the stage, it works. Why doesn't it attach to the holder clip?
mc_room loads an external swf file using a movieclip loader, and when it's completed, this function is called. That shouldn't matter, should it? I'm sure the movieclip is present and I can modify it. It just doesn't let me attach the movie!
I'm really mad at this stupid thing.
View Replies !
View Related
Attachmovie Does Not Work On Any Other Level Than It's Own?
Hi
I have a multi-layered movie. I am loading a movieclip into one layer - it contains a variety of items in it's library all linked up and ready to be used via attachMovie command.
I can make the items appear in the movie by using attachMovie on the layer the movieclip has been loaded into. I understand I can't expect to use attachMovie to make the items appear on any other level as this just won't work.
But, is it possible to use attachMovie to make the items appear within a nested layer on the layer it has been loaded onto? Like within a movieclip within the layer it has been loaded to?
I have tried this and it hasn't worked, but maybe someone can help point out something extra i need to do.
Thanks for your help.
View Replies !
View Related
Why It Desn't Work (attachMovie)
I use attachMovie to attach another MC 'day'. But it didn't work. Where is the wrong?
ActionScript Code:
spacing = 2;
var i = -1;
while (++i<arDay.length) {
name = "day"+i;
x = i*spacing;
//graph is empty MC on stage
this.attachMovie("day", name, i);
this[name]._x = x;
//Populate the Title dynamic text box
graph[name].title.text = arDay[i];
//trace("dataArray["+i+"]=" +graph[name].title.text);
}
View Replies !
View Related
LoadClip And AttachMovie Don't Work Together?
Hi,
I have an empty movie clip on stage ("mc1") that I use loadClip to get a PNG in there.
Then I'd like to attach another MC to that same mc1 ("txt1").
But it won't work.
Everything else works, and I can attach the txt1 clip to other MCs on the stage, but not mc1.
var curClip = mc1.attachMovie("txt1", "tempName", mc1.getNextHighestDepth());
A trace of curClip yields "undefined" as does trace(typeof(curClip));
Am I trying to break some laws of Flash Physics here?
(Note: trace(mc1.getNextHighestDepth()); yields 0... why's that?)
Thanks!
View Replies !
View Related
Why Does AttachMovie Not Work After A LoadClip?
Hi, i am trying to attach a movieclip from my library to the movieclip that is loaded.
It does not seem to work. I only can attach it to the _root!
In this example i have an movieclip with an idintifier link of 'round'.
As you can see i can approach the loaded movieclip, because i resized it. I can change it rotation, alpha etc.
But i can't attach a movieclip to it? It does not make any sense.. Is there a fix for it?
Attach Code
var loader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
loader.addListener(listener);
listener.onLoadInit = function() {
loadinme_mc._width = 200;
loadinme_mc._height =200;
//loadinme_mc.attachMovie("round", "round_mc", this.getNextHighestDepth()); //does not work
//_root.loadinme_mc.attachMovie("round", "round_mc", this.getNextHighestDepth()); //does not work
// this.loadinme_mc.attachMovie("round", "round_mc", this.getNextHighestDepth()); // does not work
_root.attachMovie("round", "round_mc", this.getNextHighestDepth()); // only to the root??
}
loader.loadClip("pic1.jpg", loadinme_mc);
View Replies !
View Related
Attachmovie, Why Wont It Work?
I am getting very frusterated with attachMovie()
i have the following code on the main timeline:
Code:
this.attachMovie('pic_box', 'pic_box', 0, {_x:10, _y:10})
this.pic_box.attachMovie('load_bar', 'load_bar', 1, {_x:100, _y:100})
everything is in the library correctly.
now the 'pic_box' gets attached but the other one doesn't. if i do this:
_root.attachMovie('load_bar', 'load_bar', 1, {_x:100, _y:100})
it attaches fine.
I have a class attached to the pic_box, and if i remove the class ID in the linkage panel, it attaches the load bar. It has nothing to do with what is contained in the class because if i comment out all the code but the:
class name {}
it still doesn't work.
I am REALLY stumped...
View Replies !
View Related
Attachmovie, Why Wont It Work?
I am getting very frusterated with attachMovie()
i have the following code on the main timeline:
Code:
this.attachMovie('pic_box', 'pic_box', 0, {_x:10, _y:10})
this.pic_box.attachMovie('load_bar', 'load_bar', 1, {_x:100, _y:100})
everything is in the library correctly.
now the 'pic_box' gets attached but the other one doesn't. if i do this:
_root.attachMovie('load_bar', 'load_bar', 1, {_x:100, _y:100})
it attaches fine.
I have a class attached to the pic_box, and if i remove the class ID in the linkage panel, it attaches the load bar. It has nothing to do with what is contained in the class because if i comment out all the code but the:
class name {}
it still doesn't work.
I am REALLY stumped...
View Replies !
View Related
Cannot Make AttachMovie Work
Hello Flash experts!
Can anyone help me with attachMovie?
(I'm using FlashMX)
I'm probably just being thick but I can't find an explanation of how to use this actionscript.
I have a movie clip in my library called "stage1"
I have a movie clip on the stage called"Intro"
I also have an empty movie clip on the stage called "holder"
When "Intro" stops playing I want "stage1" to be automatically loaded onto the stage.
I have tried putting this script in the last frame of "Intro"
_root.holder.attachMovie("stage1","movie1", 100);
But it does not work.
Should I have some sot of event trigger around this script e.g.
on (enterframe) {
_root.holder.attachMovie("stage1","movie1", 100);
}
Please help if you can, this is driving me mad!
Many thanks
Chazzer.
View Replies !
View Related
How Does AttachMovie() Work On Low Bandwidth?
I'm creating a slide show that a low-income user base will be viewing. So, I'm assuming they are mostly on dial-up connections. To streamline the production, I want to use the attachMovie() function and pull the images straight from the library (so I don't have to build out every photo and tween).
What I'm wondering is this: how will this run on a dialup connection? Since the photos aren't actually placed on the timeline and are pulled only when called, how can you do a preload or proper loading bar?
Is it possible to simple dump all the photos off stage on frame one -- will that work as a preloader, or will each still load individually when called with attachMovie?
Any advice or best practice info will be very helpful.
Thanks.
View Replies !
View Related
Attachmovie In A Loop ... Doesn't Work
Hi everyone ,
i'm working on a memory game (matching pairs) . Item's masks (12) will be put on the stage with a attachMovie() inside a loop . Then every mask will be move to specific location (items positions). All the positions (x & y) are in arrays (chartX, chartY). When i execute this code only the 12th item is placed on the stage. Looks strange to me. Can anyone help me please, please ...
for (i=1; i<=12; i++)
{
indexArray = i-1;
_root.attachMovie("myMask" , "mask"+i, 1);
maskName = "_root.mask"+i;
eval(maskName)._x = chartX[indexArray];
eval(maskName)._y = chartY[indexArray];
}
TIA
Natacha
P.S. My english is so bad . Sorry
View Replies !
View Related
Making A Button Work With AttachMovie
I have this code here:
Code:
_root.attachMovie("continue","star1",1);
setProperty("star1",_x,450);
setProperty("star1",_y,50);
"continue" is a button and I place it to the scene with attachMovie. I want to make that button now working that if I click on it that I jump to another frame.
but somehow I dont know how to do that
can anybody help me? I guess its a easy thing!
thanks in advance
View Replies !
View Related
[F8] Attachmovie Doesn't Work With Hittest?
I have a moving movie clip in my game, and due to some problem caused by an actionscript class I'm using, I can't use hittest on the movie clip itself. So, I tried to attach another movieclip to my original using attachmovie. When I try to hittest the attached clip, it doesn't work either.
I tried it with a rectangle movie clip just to make sure I was doing it right. I discovered that if I attach a rectangle to my original rectangle, hittest doesn't work on the attached clip. However, if I hittest the original clip, the attached clip is used as part of the original clip.
So, is there any way to fix this? All I want is something to move with my movie clip that I can use hittest on.
View Replies !
View Related
Can't Get Actionscript To Work On Attachmovie Instance
In the movie (attached to this email) users have to drag an item to one of two boxes. When the student has dragged the item to the correct box, a feedback movie clip appears as a response to this. Also, a second draggable clip appears which also has to be dragged to one of these boxes.
The problem I am having is that the second movie clip I attach from my library wil not function as a draggable clip and I am not sure why.
All my code is on the root timeline.
the .fla is at: http://www.munzamedia.co.uk/2-1-3_activity_temp.fla
View Replies !
View Related
How To Make Attachmovie Work With Mask
I am working on one movie that attaching moive to the main time line, but when I add the mask on the top of the attached moive, it does not show up. Do anybody know the reason? Will it be the attached moive always on the top of everything?
Thanks in advance.
View Replies !
View Related
AttachMovie In A Parent Movie Does Not Work
Hi
Simple question, but I didn't find the way to do this. I have a clip named Clip1 for this exemple. This Clip1 load an external Clip2. Then when I click a btn in the Clip2 I want to attach a clip that reside in the Clip2 Library to the Clip1 root.
That does not work. Any idea to do that.
Linked clip can't be in the Clip1 library
View Replies !
View Related
AttachMovie Doesn't Work Within A Custom Class?
Hey so I've just got some class called foo and foo has a method called bar. Bar wants to use attachMovie and call an ID from the library like so:
ActionScript Code:
class foo {
var myMC:MovieClip;
function foo() { /* ... constructor ... */ }
function bar() {
/* myMC is defined and on stage */
myMC.attachMovie("candy","candy_spawn",myMC.getNextHighestDepth());
}
}
But this, alas does not work.
My FLA uses import foo; and it seems that the class foo cannot access the FLA's library. Yes I have it checked to export for actionscript and export to first frame with identifier "candy"...
Is this just illegal?
View Replies !
View Related
AttachMovie Doesn't Work Inside For Loop
I have an xml file with 26 elements representing the alphabet so i can make a glossary (glossary.xml)
I am trying to attach a MC (pointer) for each letter/element in the xml file and add in the appropriate letter to a textbox (alpha_id) inside the MC.
However for some reason attachMovie won't work inside my for loop. Can anyone help me out here?
here's my code:
Code:
//load xml file
var external_xml:XML = new XML();
//ignore all extraneous whitespace
external_xml.ignoreWhite = true;
external_xml.load("xml/glossary.xml");
external_xml.onLoad = function(success:Boolean) {
if (success) {
temp_xml = this.firstChild;
lgh = temp_xml.childNodes.length;
for (i=0; i<lgh; i++) {
var alpha = temp_xml.childNodes[i].attributes.id;
//have also tried 'this._parent' as an experiment - no luck
this.attachMovie("pointer", "pointer"+i, this.getNextHighestDepth());
this["pointer"+i]._x = 40;
this["pointer"+i]._y = 40+(i*(this["pointer"+i]._height+10));
//there is a textbox instance named alpha_id in the mc pointer to accomodate each letter of the alphabet
this["pointer"+i].alpha_id.text = alpha;
}
}else {
trace ("Error");
}
};
View Replies !
View Related
AttachMovie() Doesn't Work Properly When Swf Is Loaded Externally
I'm using Actionscript 2 in CS3.
My problem is a little bit hard to explain, so I just try to make it as clear as possible . . .
I have a main swf, which loads another swf using loadMovie, like so:
PHP Code:
loadMovie ("photogallery.swf", _root.empty_mc);
This swf (photogallery.swf) then loads other external movies depending on which button is clicked, in the same way:
PHP Code:
loadMovie ("ranges/obsession.swf", _root.empty_mc);
The other external swfs (such as "obsession.swf" in the example above) are slideshow galleries which load clips from the library using attachMovie(), show them for an amount of time specified by an interval, then attach the next movie over the top.
The code for these is a bit long winded, but looks like this:
PHP Code:
stop();
delay = 9000;
total = 7;
p = 0;
currThumb = "";
prevThumb = "";
names = new Array ("one_mc", "two_mc", "three_mc", "four_mc", "five_mc", "six_mc", "seven_mc");
xPosition = new Array (130, 97, 165, 128, 73, 131, 101);
yPosition = new Array (25, 104, 52, 52, 52, 22, 47);
th_names = new Array (th_one_mc, th_two_mc, th_three_mc, th_four_mc, th_five_mc, th_six_mc, th_seven_mc);
firstImage();
function displayPictures (pic, xPos, yPos)
{
tran_mc.gotoAndPlay("play");
empty_mc.attachMovie(pic, "pic_mc", this.getNextHighestDepth(), {_x:xPos, _y:yPos});
};
function nextImage()
{
if (p < (total-1)) {
p++;
displayPictures(names[p], xPosition[p], yPosition[p]);
currThumb = th_names[p];
currThumb.gotoAndPlay("over");
prevThumb = th_names[(p-1)];
prevThumb.gotoAndStop("up");
picture_num();
slideshow();
}
};
function firstImage()
{
displayPictures(names[p], xPosition[p], yPosition[p]);
currThumb = th_names[p];
currThumb.gotoAndPlay("over");
prevThumb = th_names[(total-1)];
prevThumb.gotoAndStop("up");
picture_num();
slideshow();
};
function slideshow()
{
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow()
{
clearInterval(myInterval);
if (p == (total-1))
{
p = 0;
firstImage();
} else {
nextImage();
}
}
} ;
So far, so good - the swfs all load OK and the galleries work how they should . . . the first time around. But if you click a button in the main swf that takes you a different part of the timeline, then return to where you were (i.e. loading both lots of external swfs again), the galleries go a bit haywire - the first interval gets very short, much less than the 9000 milliseconds it's supposed to be, and some of the clips in the library don't load.
I put in a series of diagnostic trace statements, and as far a I can tell from that, the code still runs through (i.e. it's not skipping anything), but for some reason it doesn't execute properly - instead of showing the first picture followed by the second, it shows the first, third, fifth; then if you click away and then back again it shows the first, fourth, seventh and so on.
I can't figure this out, because as far as I can tell, the external swfs should just be doing their own thing every time you click on them. There are no functions in the main movie that affect them or anything.
Does anyone have any suggestions or explanations? I would welcome any help that anyone could give. Sorry the post is such an epic . . .
View Replies !
View Related
Can't Get Multiple Instances Of Quiz Buttons To Work Using AttachMovie
I have attached two zip files, myVersion & bookVersion.
bookVersion is from the "flash & xml" book source code which is a simple quiz game and although this is written in flash 5, it works without a hitch. The problem is with my version, I can only get one instance of a button at a time, yet the script is identical to the book. I can't get the score counter to work as it returns "NAN", yet this is also identical to the books script .
Hope someone can help, regards.
View Replies !
View Related
Button With 2 Functions? Onrelease=true, Onrelease=false
I have a button that uses a function to set the visibility of an mc. BUT it's called with an 'onrelease' and I would like the button to change the visibilty back to false on the next onrelease. Understand?
Here's my code:
list_btn.onrelease = function() {
playlist._visible = true;
}
Now I want to press the same button and have the mc (playlist) go back to false. I tried using some 'if' statements but just couldn't seem to get it right. My brain is just not working today.
Need some help please!
View Replies !
View Related
|