Randomly Loading Mc From Library, And Attaching Random Movie To It
Hi guysBasically, I have movie1, movie2, movie3, movie4 in the library, with linkages.These are just 5 frame clips, with a single dummy_mc moving statically over the 4 frames.I need these to be picked randomly and placed (each has its own set of co-ordinates where it should appear) on the stage at a random set interval (ie, every 2-3 seconds).There are also 7 items (item1, item2, etc) in the library.So once one of the 4 movies has been placed on the stage, I need one of these 7 items to randomly attach itself to the dummy_mc within that movie (and, I guess, generate instance names etc)Would greatly appreciate any light someone can shed, i've been playing with some code, but to no avail.Cheers
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-18-2005, 01:17 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Attaching Randomly Movie Clips From The Library And Controling Them By One Function
hi,
i have a very important project to do, and i'm so confused...
there are 2 main questions i can't deal with:
1. i want to add randomly movieclips from the library to my stage , but I didn't succeed (the FLA i made is attached-i really don't understand what i did wrong)
2. let's say i succeed to add the above mentioned movieclips.
how can i controll multiple movieclips by onley one function???
(especially if they were added to the stage by attachMovie method)
(what I want to do is to:
* make the movieclips move from the upperborder to the bottom, and to make them dissappear when they reach there (ofcourse this should occure till the game is over)
* change the movie clip color if it being touched by the hero of the game.
i know how to do it in generaly, but i am totaly clueless when i ned to do it for all the movieclips, especially if they are being attached to the stage onley by their linkage name.
i will be very very gratefull to any help in any kind (especially if you will direct me to tutorials in this subject or FLA files that may help).
thanks in advance.
Attaching Randomly Movie Clips From The Library And Controling Them By One Function
hi,
i have a very important project to do, and i'm so confused...
there are 2 main questions i can't deal with:
1. i want to add randomly movieclips from the library to my stage , but I didn't succeed (the FLA i made is attached-i really don't understand what i did wrong)
2. let's say i succeed to add the above mentioned movieclips.
how can i controll multiple movieclips by onley one function???
(especially if they were added to the stage by attachMovie method)
(what I want to do is to:
* make the movieclips move from the upperborder to the bottom, and to make them dissappear when they reach there (ofcourse this should occure till the game is over)
* change the movie clip color if it being touched by the hero of the game.
i know how to do it in generaly, but i am totaly clueless when i ned to do it for all the movieclips, especially if they are being attached to the stage onley by their linkage name.
i will be very very gratefull to any help in any kind (especially if you will direct me to tutorials in this subject or FLA files that may help).
thanks in advance.
Sound Only Attaching From Preloader Library Not Main Movie Library
Hi guys, i've got my main movie with sounds used in classes attached from the library via attachSound. works fine when run on its own, but when run through a seperate preloader swf it only works when the sound is in the preloaders library.
Any help would be much appreciated.
Loading Random Movie Clips From The Library?
ive had a good long look through the tuts and on google and ive found a few things but madly over complicated for what i need.
what i need is to click a button and a random image appear in a specific part of the screen.
Im using flash mx, understnd the math.random() function and can build arrays.
Can you direct me to a simple tutorial or post some actionscript to give me a clue.
Thanks
Randomly Attaching Movie Clips
Hi,
I want to randomly import movie clips from a 'library.swf';
(all the mc's within this .swf are linked to be exported as
"01", "02", etc.)
The code at the moment looks like this;
1st frame;
placeHolder.loadMovie("library.swf");
2nd frame;
stop ();
// mc 01
placeHolder.attachMovie("01", "my1", 2);
placeHolder.my1._x = 8;
placeHolder.my1._y = 18;
placeHolder.my1._xscale = 100;
placeHolder.my1._yscale = 100;
What I want to do is to, instead of using "01", "02", etc.
placeHolder.attachMovie("01", "my1", 2);
and use an action to randomly import movies from "01" to "50".
Any help or comments will be greatly appreciated,
Thanks,
Lenny.
Loading External SWFs And Attaching Items From Their Library?
This was often difficult in earlier versions of Flash.. is it any easier now? How is this done?
I would like to have an empty FLA pointing to my main/document class, and have all assets load as linked library items from external SWFs. I would like to load all of the SWFs at runtime first, then once everything is loaded, have instant access to the various linked library symbols through code to place them on the stage when necessary. Is this possible, and how to structure this?
Thanks for any advice,
SB
Attaching Movie Clip From Library
I am having trouble loading a movieclip from the library.
This is the script I have
attachMovie(logo, logo1, 5)
What am i doing wrong?
Problem Attaching A Movie From Library
I modified the code for the hover captions that is on kirupa.com
The reason i had to try and modify it is because i am generating thumbnails from an xml document and when i want to use the hover caption it is creating the hover on the depth of -16745 or something and all of the thumbnails are on levels 1-10 or however many there are
I can't seem to figure out how to get the caption to be above the thumbnails.
here is the code i have so far, hope someone can help. but this code so far doesn't show the caption image that I have in my library
argh
Code:
captionFN = function (showCaption, captionText, bName) {
if (showCaption) {
//var caption:MovieClip = _root.createEmptyMovieClip("hoverCaption", getNextHighestDepth());
//trace(this.getDepth());
this.attachMovie("caption", "cap_mc", this.getNextHighestDepth());
//cap_mc.caption_txt.text = captionText;
if ((bName._width+bName._x+cap_mc._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
cap_mc.onEnterFrame = function() {
cap_mc._x = _root._xmouse+xo;
cap_mc._y = _root._ymouse+yo;
cap_mc._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap_mc.removeMovieClip();
}
};
Attaching A Movie From Library After An Event?
Hi all,
my base class loads xml data and then creates the navigation etc in the handler method. In the handler tracing 'this' still returns the base class but can I cannot use this.addChild(something) to add a new MovieClip to the stage. but if I paste the same code in to the constructor or init methods then it works?? it also works if I use this.someMoveClip.addChild(something) just not directly on this? This is really confusing me, code below
Code:
package
{
import flash.display.MovieClip;
import flash.events.Event;
public class Application extends MovieClip
{
public var xmlData:XmlData;
private var _navigation:Navigation;
private var _home:HomePage;
public function Application()
{
trace('New Application');
init();
}
private function init()
{
// load the xml data
xmlData = new XmlData();
xmlData.addEventListener("onLoad", initPages);
xmlData.load('work.xml');
}
private function initPages(e:Event)
{
trace('handleXmlLoaded')
var s:Square = new Square();
s.x = 0;
s.y = 0;
this.addChild(s);
// build navigation
_navigation = new Navigation(this.navigation_mc);
}
}
}
Attaching Movie Clip From Library Problem
I am trying to attach a movie clip to my main movie using a clip from the library that is using "import for runtime sharing".
When I use the attachMovie function, the clip doesn't appear. It only appears if a drag the clip to an area off the stage.
Is there a way around this? Is it possible to replicate the process of draging in a movie in action script?
Thanks
[MX04] Attaching Movie Not In Symbol Library
I'm trying to attach a movie that I created as an emptyMovieClip to a new path (so it loads inside a masked movie clip). The code works fine when I use an object from the symbol library, but I can't get it to take a movie clip I create in the code. How could I do this? Or should I use something other than attachMovieClip?
myPhotoMC = _root["main_"+i]["fullPhotos_"+i]["photo_"+i+"_"+j];
moveClip = _root["main_"+i]["screen_"+i].area.attachMovie(myPhotoMC, "container", 3000);
}
Is there a way to just change the target path of a movie clip instead of going through all this?
Thanks!
Attaching Library Elements From Main Movie
Hi all,
I did a search on the site but all the example were other way around that I would like to implement, so will ask it straight away.
I have an external.swf movie that I am loading into the main.swf movie. I want to display a movieclip from the main.swf library in the external.swf. Any ideas how this could be achieved?
I have set the linkage Id for the movieclip in the main.swf but I am not able to load it. Obvisouly if I bring the clip into the external.swf it will load nicely. I am using the attachMovie() method.
Thanks
Attaching Movie Clips From Library With ActionScript
Hello,
I'm trying to target a button within a movie clip that is loaded using ActionScript and I'm having some trouble. Here is my issue: I have two movie clips which reside in the library of my main file called "screenOne_mc" and "screenTwo_mc". Both movie clips contain identical buttons with an instance name of "nextBtn." Both movie clips have linkage identifiers which exactly match their library names. On frame 1 of my main timeline I have the following script:
// attach clip
attachMovie("screenOne_mc", "s1", 0);
swapDepths(0);
// remove ScreenOne_mc and attach ScreenTwo_mc
s1.nextBtn.onRelease = function() {
removeMovieClip("s1");
attachMovie("screenTwo_mc", "S2", 1);
}
// Trace the s2 button clip
this.s2.nextBtn.onRelease = function() {
trace("s2 has been clicked");
}
Attaching screenOne_mc works as does attaching screenTwo_mc, the issue that I'm having that the click of s2.nextBtn doesn't work. I suspect that I'm just incorrectly targeting the the movie clip but I'm just not sure where it is?
Has anyone else run into this issue? Any suggestions?
Thanks!
Jaivin
Attaching Movie Clips At Runtime From Library
Dear All,
I have 6 different clips in Library with the Linkage class given to following names: Class: mc0, mc1, mc2, mc3, mc4, mc5, mc6,
And I want to attach these clips dynamically at run time using the for loop in AS3.0:
For( var i=0; i<6; i++)
{
What should be the code for this at runtime attachment?
//
}
Regards,
Sridhar B
MCs Appear Randomly From The Library And Move Around Randomly
Hi
Onmy stage I have a MC, and when I click it a random MC from the Library should appear and move around randomly.
I'm using this to make it move around randomly http://www.kirupa.com/developer/acti...dom_motion.htm
But I can't figure out how to make the random MCs appear from the library.
And should I put the random moving script on each of my ten MC?
Hope somone can help.
Best regards
Jost
Attaching Random Clips To A Movie
Help needed! - I'm starting to learn Flash and actionscript and would apreciate any help. I need to build an animation with images that cross-fade randomly at the same time as text. There are 2 areas; the image area and the text area so there will always be both an image and text but displayed at random. I know how to set up the clips with animation tweens to fade them in and out, but am not sure how make them random or how best to attach them to the movie. Also is a preloader required for this kind of animation? What is the best way to go about this, I want to do it right from the start.
Thanks
Load Random Movie, Randomly Plays Next
I am using the load random movie script: (http://www.kirupa.com/developer/acti...ndom_movie.htm)
with no problems. I would like to add some functionality to it though. How would I make it so once the movie loaded plays, it will play another movie from the array, but picked randomly as well?
Attaching Multiple Random Movie Clips
Why is the attachMovie overwriting previous carnations of my MovieClip. I thought that the "+ i" in "MC_Big" + i would solve that problem. Anyone have a suggestion?
var i = 1;
obj2 = new Object();
obj2.interval = function(s) {
attachMovie("MC_Big", "MC_Big" + i, this.getNextHighestDepth(), {_x:330, _y:220});
trace("AddMagic function added");
}
setInterval( obj2, "interval", 2000, "interval function called" );
Thanks!
Attaching Btns Randomly From An Array
I spent the past couple days learning this stuff so I know my a.s. might be a little jacked up. Anyways, I want to place 5 questions randomly from the library using linkage onto(or into) 5 empty mc's on my stage. I got the randomization of the instance names to work out and tried calling to them using "array name[array #]". Well you can see for yourself... what am I missing.
Array.prototype.randomize = function() {
var i = this.length;
if (i == 0) return;
while (--i) {
var j = Math.floor(Math.random()*(i+1));
var tmp1 = this[i];
var tmp2 = this[j];
this[i] = tmp2;
this[j] = tmp1;
}
return this;
}
var arr = new Array("q1_ans1","q1_ans_2", "q1ans_3", "q1ans_4", "q1ans_5");
/*trace(arr.randomize());
trace(arr[0]);
trace(arr[1]);
trace(arr[2]);
trace(arr[3]);
trace(arr[4]);
trace(arr.length);*/
this.empty1.attachMovie("arr[0]","arr[0]",1);
this.empty2.attachMovie("arr[1]","arr[1]",2);
this.empty3.attachMovie("arr[2]","arr[2]",3);
this.empty4.attachMovie("arr[3]","arr[3]",4);
this.empty5.attachMovie("arr[4]","arr[4]",5);
Loading A Movie Randomly?
Is it possible to have a selection of 4 movies, individual .fla files, where by one is selected at random and shown in one single .fla?
Basically Im trying to set up a screensaver that will select one of four movies at random.
Any ideas?
Loading / Attaching Movie
hi guys,
I am trying to load a movie at a particular level .. using the following script, but it is not working.
Code:
loadMovieNum("a.swf", 2);
I tried hard to make this code working but failed, then i though may be i should use "loadMovie" to load "a.swf" at the target DUMMY movie. for this i did this...
at the first frame of my movie i wrote
Code:
_root.attachMovie("bg", "bg", 2);
the code worked fine and the movieClip "bg" was loaded from library to the stage, but it was loaded at level0 ... instead of level2.
and then when i used loadMovie for this target movie ... it occupied the "root" which it should be.
can you people help me to load the movie at some other level ... i am sucked by AS-2 to load a movie.
Randomly Loading Movie Clips
Ok, Im going to try and attempt to explain this....
I want to make an MC (lets say we call it MC_main), that contain or loads other MC's (from a list of MC's in the library, lets say MC_A, MC_B, MC_C, MC_D......to M or something)...in a random sequence. How can I do this?
Thanks
Help: Loading A Movie Clip Randomly
Hi everybody!
Let's say I have created a picture frame in scene1 (main scene) and I want to place randomly one of four movies into the frame everytime the user returns to the main scene.
How can I do this? I know how I can load / stream a movie from a webspace, but I have no idea how I can let flash choose one randomly.
Thanks for any tip,
Chris
Load Random Movie Clip From Library
i need a way to have one of three versions of a banner randomly load upon refresh, but they cannot be external files.
I'm thinking loading movie clips from the library might be the best way to go but I'm pretty foggy and I haven't found much out there on the Web the get me started in the right direction.
any takers?
Loading External Movie & Playing Randomly
Hi,
I need help with my project. I have a bunch of movies that I want to randomly play on the main movie. So basically each time the user comes to the website, a random movie is loaded from a folder. Please help!
Cheers!
Actionscript - Randomly Loading Movie Clips - PLEASE HELP
Hi,
I am trying to create a side banner Flash graphic on my website that randomly loads (one of 15 different) movie clips. Then, I need the clips to play back to back in random order - sort of like a non-interactive randomized image veiwer that plays while the end user veiws the webpage. Can anyone help me with the code? I am an actionscript novice, so I'm not sure how to approach this problem. Is it more efficient to load movie clips from the library, or an external folder?
Also, the clips are images that fade in and out (alpha) - one image per movie clip. How can I code these movie clips so that they fade in for 45 seconds, stay for 20 seconds, and fade out for 15 seconds?
I would appriciate any help...
Thanks,
-Ena
MX 2004 - Randomly Loading Movie Clips (help Meh)
I need to make something that mimicks The Dancer over at http://www.globz.com
I've created all the movie clips
but I don't know where to start with the loading and unloading of the dancing bits
The buttons at the bottom scroll through movie clips with different movement. So the "arms" button would load arms01, then when it's clicked again, it would load arms02, clicked again it would load arms03, and then repeat when it reached the end
Can anyone help me with the actionscript that would reside on each button?
MX 2004 - Randomly Loading Movie Clips (help Meh)
I need to make something that mimicks The Dancer over at http://www.globz.com
I've created all the movie clips
but I don't know where to start with the loading and unloading of the dancing bits
The buttons at the bottom scroll through movie clips with different movement. So the "arms" button would load arms01, then when it's clicked again, it would load arms02, clicked again it would load arms03, and then repeat when it reached the end
Can anyone help me with the actionscript that would reside on each button?
Randomly (externally) Loading Movie Clips
I have a section in my site that I want to be able to load random swf's from a folder on the server. So basiclly I will publish 5 or 6 diff movies that I would like the main movie (embeded in my main page) to grab one, play it then grab another or the same one again. Does anyone have the code to do this? It does not sound to tough to pull off. Of course I was thinking of maybe having preloaders in the begining of each swf, unless that is a bad idea. Thanks
Loading And Attaching Image As Movie Clip
What's is wrong with that ??
loadMovie("P1000546.JPG","pic3_mv");
pic3_mv.createEmptyMovieClip( "pic3_mv" , 0 );
attachMovie( "pic3_mv" , "pic3_mv",0);
pic3_mv._x = 0;
pic3_mv._y = 0;
The iamge file is external and is located in the sae directory as swf file.
Dyanamically Loading Images Randomly From The Movie Clip
hi,
i had developed a flash file of 300*75 dimensions, and i created 7 movie clips of same dimensions 140*75 and are scrolling from right to left and the images will be dynamically loaded from a folder outside.
Here my question is when the images are moving from right to left ie., image 1 to image 7 moving the image 1 should have to become as image 8 and so on from the same folder .
can any body help in this regard.
Thanks and Regards
srinivas balla
Loading And Playing Internal Movie Clips Randomly
Hi!!! Does anyone out there know how to get movie clips to play randomly? Here's what I want to do:
I have four movie clips already created and I want to make it so that when someone visits the page and accesses it for the first time, one of the four is randomly selected and plays (I also want to be able to tell it what frame of the movie clip to go to)!
I know some genius out there has the answer! Help!!!
[Help] Attaching An MC To An MC In The Library
Hey guys, I was wonderinf if its possible to add an MC to an MC thats in the library.
Say I had "closetMC" inside of the library and I wanted to add "shirt1" from the timeline into "closetMC". Is this possible? And if so, how could I achieve this?
Thanks a bunch!
Attaching Mc From Library In AS3
Hello:
I´m searching, not finding some help about attaching MCs from library to stage with AS3. I can´t understand what´s the problem. I´ve tried dozens of solutions but without success. Please anyone has an idea.
Here is my code:
ActionScript Code:
function boton(nombre_mc:String, other_mc:String){
this[nombre_mc].buttonMode = true;
var container_mc:MovieClip = new MovieClip();
addChild(container_mc);
var theClassName:Class = getDefinitionByName(other_mc);
var theClass:MovieClip = new theClassName();
this[nombre_mc].addEventListener(MouseEvent.MOUSE_OVER, efecto);
function efecto ($event:MouseEvent) {
$event.currentTarget.gotoAndPlay(2);
var caraBio:* = new tempClass();
container_mc.addChild(theClass);
}
}
boton("First_mc", "FirstAA_mc");
The First_mc and the FirstAA_mc are both linked with the same name to AS.
When I test the movie, it says:
error 1046
error 1118
error 1180
Anybody knows how to meka a function to attach a library MC.
Thanks.
Attaching A Library MC From A Loaded Swf.
//on (release) {
// _root.main.attachMovie("att2", "newname2", 1);
//}
This does not work. Any help?
Trying to attach a movie clip from inside the Library to a blank MC on Main Stage from a loaded swf movie.
Is this possible?...or should my code work with better path.
M
Attaching An MC From The Library W/ Code Already...
I need to attach my character from the Library w/ code on the actuall MC, not within. I DO NOT want to use a blank mc to store him in then add the code on the inside. He needs to load w/ code on his parent MC from the library.
-Tyler
any ideas?
Attaching Scrollbar From Library
Hi
I'm trying to use the Flash MX scrollbar in MX 2004 but I am having problems with it. If you are wondering why I don't use the MX 2004 textarea component, it is because it is pants and has more bugs than your average garden.
I'm creating my textfields using createTextField and then attaching the scrollbar from the library thus:
/////////////////
_root.question_mc.attachMovie("FScrollBarSymbol"," insScroll_mc",100);
_root.question_mc.insScroll_mc.setScrollTarget("_r oot.question_mc.ins_txt");
_root.question_mc.insScroll_mc.setScrollContent("_ root.question_mc.ins_txt");
_root.question_mc.insScroll_mc._y = _root.question_mc.ins_txt._y;
_root.question_mc.insScroll_mc._x = _root.question_mc.ins_txt._x + _root.question_mc.ins_txt._width + 25;
_root.question_mc.insScroll_mc.setSize(_root.quest ion_mc.ins_txt._height + _global.textBoxSpacing);
_root.question_mc.insScroll_mc.setSmallScroll(14);
_root.question_mc.insScroll_mc.setEnabled(true);
/////////////////////
I found TWO methods in the MX help for setting the target textfield for the component, yet neither seems to work. All the other changes I make to the scrollbar including setSmallScroll work, but not target.
Can any bright sparks out there shed some light on this little puzzler?
Ta
Barry
Attaching A MC From A Library And Setting Its X And Y
Hi all!
I have a movie in the library which I want to attach to the stage by code. Here's the code I've been using:
Code:
count = 0;
_quality="High";
onEnterframe = function () {
attachMovie("main", "circle"+count, count++);
};
This code works, but it puts the attached MC (circle) in the middle of the stage. How can I set its X and Y coordinates to place it exectly where I need it? I tried a few things, but the code I tried shifted the entire stage instead of that MC alone... So how can I do it?
Thanks in advance!
Attaching Several Movieclips From Library?
Hey
I have a for-loop where I want to attach several movieclips from library. I have tried:
Code:
var movie:MovieClip;
for (i = 0; i < 20; i++)
{
movie = attachMovie("MCname", "MCname"+i, getNextHighestDepth);
movie._y = 31+31*i;
}
When I test the movie only the last clip shows. Is this because it only works for 1 clip. I've tried some other things like duplicateMovieClip and so on, but can't get it to work..
[F8] Attaching A Mc From The Library Into A Loaded Swf
hey folks
I'm trying to do this
Code:
targetMC.attachMovie("bullet_bar", "bullet_bar", 20);
the targetMC is the location of another loaded swf file. the bullet_bar movieclip is in the library of my root swf
can this work cos I'm having a few problems
Attaching MC From Library By Function In AS3
Hi everyone:
I´m trying to create a mc (that works as a button). I´d like when the cursos goes over it, the mc run to frame 2 (this is obteined thanks to xxneon in other thread) and also that it put a mc that exist in the library.
If the mc is with the "export for as" checked, and the name is MC_mc, why this doesn´t work:
ActionScript Code:
function boton(nombre_mc:String, cara_bio:String){
this[nombre_mc].buttonMode = true;
this[nombre_mc].addEventListener(MouseEvent.MOUSE_OVER, efecto);
this[nombre_mc].addEventListener(MouseEvent.MOUSE_OUT, inicio);
function efecto ($event:MouseEvent) {
$event.currentTarget.gotoAndPlay(2);
var caraBio:cara_bio = new [cara_bio]();
addChild(DisplayObject(caraBio));
}
function inicio ($evente:MouseEvent) {
$evente.currentTarget.gotoAndStop(1);
}
}
boton("other_mc", "MC_mc");
(other_mc is in the stage yet)
Thanks
Attaching Objects From Another Library
I have the following scenario: I have a main.swf, and it loads a lib.swf, in which library are some movie clips that I want to attach in main.swf. Is it possible? (PS: I do not want to attach the symbols inside the loaded lib.swf. What I want is to use lib.swf's library in main.swf).
Thank you.
Attaching MovieClips Not In The Library
I'm just coming back to Flash after not using it for a few years, and I'm struggling with a particular aspect of ActionScript 2 (I'm still using Flash 8). I am creating something along the lines of an image grid or "video wall" of still images. The image grid will randomly show different images, and I want any cell in the grid to have access to the full array of images to choose from.
I want to dynamically load in the individual PNG bitmap files from the server to facilitate swapping them out, rather than baking them into a SWF. At the root level, I've managed to use MovieClipLoader to load my PNG files into a dynamically generated array of MovieClips. My image grid is a bunch of instances of of a MovieClip which contains a mask, decorations, and a placeholder MovieClip for the images.
What I can't figure out how to do is attach the PNGs to the placeholder clips. It seems like my two options are attachMovie and attachBitmap. However, both of them require you to specify a linkage ID to a library asset, which I do not have- I have an array of MovieClips not contained in the library!
I'd really appreciate it if someone could point me in the right direction.
Attaching A Clickable MC From The Library
Hi there,
When I click my 'hit_mc', 'hitarea_mc' gets placed on the stage from the library. When I click 'hitarea_mc', I want it to disappear.
So Ive done the following, but the newly attached hitarea_mc refuses to be clickable. How would I tell AS to make it thus ....
Thanks..
Code:
var a:Number = Stage.width/2;
var b:Number = Stage.height/2;
function attach (){
_root.attachMovie("hitarea","hitarea_mc",10,{_x:a,_y:b});
}
hit_mc.onRelease = function(){
attach();
}
hitarea_mc.onRelease = function(){
this._alpha = 0;
}
Attaching MovieClip From Library (Please Help)
Hello
I have created a textfield and then attached a movieclip as a background on top of which I wanna place the text field just like a button.
Here is the code
var txt:TextField = new TextField();
var bg:MovieClipClass = new MovieClipClass( );
bg.addChild( txt );
txt.text = "Hello World!!";
addChild(bg);
The movieclip and text field are displayed on the stage but the text field is not on top of the background clip it is always away from the clip I have even tried
assigning the moviclip x and y coordinate to text field but does not work.
Any help will be well appreciated
Thank in advance
Attaching MovieClip From Library (Please Help)
Hello
I have created a textfield and then attached a movieclip as a background on top of which I wanna place the text field just like a button.
Here is the code
var txt:TextField = new TextField();
var bg:MovieClipClass = new MovieClipClass( );
bg.addChild( txt );
txt.text = "Hello World!!";
addChild(bg);
The movieclip and text field are displayed on the stage but the text field is not on top of the background clip it is always away from the clip I have even tried
assigning the moviclip x and y coordinate to text field but does not work.
Any help will be well appreciated
Thank in advance
Attaching Sound From Library Using Variables
I´ve been having a huge problem with flash lately. I´m setting up a site using a whole lot of levels. And on one level I'm using a soundpanel to control the background music on the site. I wanted to give the user the opertunity to choose between three different types of background music. But that requires a great deal of bandwidht for the user. So I thought I´d load each song in on a different level with a preloader.
I started by setting a variable for the swf file being loaded as the sound file and another variable for the linkage identifier being used to attach the soundobject directly through the library. I then use this variable to load the sound into a soundcontainer on the soundpanel level. My problem is that the sound doesn´t even play or anything. Has anyone tried this before... or have any experience using variable with the sound object. I´ve been staring at this same problem now for days and it´s driving me insane. I´ve tried at least 7 different appraches changing the way I use the variables but nothing works.
|