ActionScript 2.0 :: Attaching Movies Within An Attached Movie?
Mar 21, 2008
I have a website, when you click a menu item it fades the current page out, and the selected one in. No problems with that, it all works well.
The only problem is, within those attached movies, all the actionscript doesnt work. I have, for example, a research page, which have 4 buttons, each of which attach a movieclip to and empty movieclip... Just a simple attachMovie function, but it doesnt work. If copy the research movieclip into a seperate flash file, everything works and the movies are attached fine, but in the website .fla, after the research page is loaded itself, none of the movies attach properly.
Are there any known issues with attaching movies within an attached movie?
As most of you don't know, I've been creating an rpg game. And, after several tries of art making, etc, I have finally moved back into coding the game. And now, I'm stuck on the equipment system idea. At first, I thought I would just place a bunch of goToAndStop's for each movie clip to go to a frame that has that certain armor piece. This was my first idea for an equipment system. However, after doing some research, and realizing how much lines of code could be saved, I started looking into simply adding and removing movie clips from the character as my new equipment system idea. Now.... on to the problem.
Basic want/ overall achievement wanted: Create an equipment system, which will basically attach movie clips (items) onto characters, which themselves will already be attached movie clips on the stage.
Problem: What is the exact code to do this? And Is there a better way to do this for an equipment system (a less laggy or more efficient way perhaps that I'm not seeing; Check the code below to get a better idea of what I'm talking about)?
Part of the code (or basic idea of code; see comments for extra details
code: //Don't worry I have an OnEnterFrame function here; //attachedObj= the character; figure= the MC name of the character; attachedObj = attachMovie("figure", "figure"+1, 1);
I have my code in the root first frame. I would like to know is it posible to attach movie from the library to array, but tu have that array created in some movie clip so the path to the newly created instance would be _root.some_movie_clip.array[i].
the code goes like this:
Code: for (i=0; i<11; i++){ displayed_icons[i] = attachMovie("my_library_mc"+i, "new_mc_"+i, this.getNextHighestDepth());
Does anyone know of a way to use the attachMovie() function to attach movie clips into the root timeline from the library of a movie that has been loaded into the root movie?I want to place a series of movie clips into a smaller movie that is loaded into the root timeline when needed and be able to script the linked movie clips in the library for use in my root timeline
I have a movie called "my.fla" in which I attach some MC's.I also have buttons that load swf's in a "container".But when I test the buttons,the attached MC's in "my.fla" keep appearing before the swf loads.I tried EVERYTHING with removeMovieClip,but I can't get it to work(The swf's I load also have attachMovie in them)
I am attaching a bunch of instances of a movieClip to my stage and I want to call a function in this movie clip that I'm attaching however I don't seem to be able to access the movieClips functions. Is there any known reason why this may be happening, something I don't know about attached clips? I'm doing something similar to whats below
Code: myPointer = attachMovie("libraryName","myNewName",newLvl); myPointer.doMyFunc(); I know the clip is attaching correctly because I can see it, but I can't seem to access any functions within the attached clip. I also know that "myPointer" is correctly addressing the attached clip because I can change the clips properties such as width and height.
i am loading some thumbnails from an xml file into a movieclip using attachMovie() - each thumbnail loaded is in it's own MC inside the 'container' MC. everything works great but i need to be able to scroll the thumbnails b/c the number of thumbnails can change but the space they have to fit into cannot. make sense? if attach them to a scrollpane or a textarea instead of a MC it only shows the last thumnail loaded or iterated in the for loop.
Code: articleNos = seasArts.firstChild.firstChild.childNodes.length; var item_spacing = 55; var item_count = 0;
When I dynamically / randomly attach movies to the stage I dont want my movies to overlap eachother... How to do this? I tried using hitTest but that didnt work for me, so I wrote some kind of hittest function myself... but that doesn't work right either.
I am having problems accessing a button after I have attached it to the stage from the library... My code is as such:
[Code]...
On the rollover - the movie recognises nothing as executable. OK >> Yes - I have linked in the properties, an identifier for AS Export .. for the original map_functions, inside it is an MC called close_mc - This MC is linked for AS Export as close_mc Why is this not working? PS. the function calls are from Lacos Tween engine.
I'm trying to attach several movie clips into another movie clip. I can add the movie clips successfully . However, the movie clips start from the middle of the main movie clip that I used as the background layer for the other movie clips. Is there any way to make it located to the top left? Here is the code I used:
scol and srow are the attributes that represents the starting locations from the left and top. (I used 10 for the variables scol and srow the movie should be located 10 pixels away from the top and left) 32 is the height and also width of the movie clip to be added.
(I know sometimes actionscript is not so powerful to implement such kind of processes. Since I have not time to wait for the another version of actionscript
ive got these clips on stage and add event listeners in an array :
[Code].....
but i want to have nothing on stage and attach the same clip from the library a certain amount of times and have them put themselves into the array, is this possible?
i have one movieclip in Library named 'Tshirt' and this shape is like Tshirt.Now i have 2 diffrent blank movieclips named 'blank_mc' and 'blank copy_mc'.I am adding 'Tshirt' by CS3 code in both movieclips diffrently.After that i am masking blank_mc with blankcopy_mc.Now when i add some thing in blank_mc, outside the tshirt area then it also visible, which should not happen because one tshirt is masking the other and i added some movieclip in only blank_mc.What the mistake i am doing?
I have the following code in a file called HelloWorld.as:
package{ import flash.display.Sprite; public class HelloWorld extends Sprite { public function HelloWorld() { trace("Hello World"); } }}
I open up a new AS3 file, go to Properties and enter "HelloWorld" in the class field. Then I press ctr+enter to play the resulting swf. Nothing happens, not even a compiler error.
I'm trying to create a simple platform game and decided to use movie clips for each move ment.I created a movie clip for the character jump called jump_mc and want to simply attach it to the UP keypress so it plays and removes everytime i press up on the keyboard. I've scoured the net but can only find movie clips attached to buttons.
The product is a maze game, where you have to navigate through the dark with a flashlight. Now, whenever I walk into a wall, my character stops, however the "flashlight" (a filter that reveals the texture beneath a mask) floats through the walls as if they didn't exist.
What I am asking, is if there is any way I can make the two movie clips attach to each other in any way, and not separate from each other. I tried applying the "player" hitTest code to the "filter" and "mask", however this caused the flashlight graphic to glitch and get out of position
I'm trying to just attach a movie clip inside of another movie clip, and it's not working...which is beyond me. The following code is written in an actions layer within the first movie clip (main_mc). I want to attach a close button to close an externally loaded swf, and the close button has to be on top of the externally loaded swf, and it's not attaching, so therefore I can't close anything.[code]any glaring mistakes that I can't see? o.O this is really confusing, it seems like such a simple task, I must be missing the greater picture.
Firstly, I want to be able to push the space bar on my keyboard during a swf, and for a movie clip to appear on the stage. This is what I have so far: Code: onClipEvent(enterFrame){ if(Key.isDown(Key.SPACE)){ _root.attachMovie("Explosion", "Explosion"+i, _root.getNextHighestDepth()); _root["Explosion"+i]._x = _x; _root["Explosion"+i]._y = _y-20; }} but its not working....
Secondly, I want A movie clip to spawn in the middle of the stage, then randomly travel outwards to the edge of the stage, then dissapear. And this needs to happen over and over, with the same movie clip travelling to a different place each time. This is what I have so far : Code: onClipEvent(load){ timer = 0; i = 0; a = 0; b = 0; [Code] .....
I want to attach a Movie Clip of a laser I made to a class. Currently I have no animation because that's the least of my problems.
The Laser is meant to fire when I press spacebar but instead i get an Error 1009 Below i have included my Code dealing with the Laser and Shooting By the way nothing crashes its just the laser will not spawn on the stage.
This is the Code on the Stage dealing with the Laser
function shoot(X:Number,Y:Number, A:Number):void { var b:Laser = new Laser(X, Y, A); addChild(b);
I am trying to attach my movieclip bubble to my dynamic text field called caption but my code isn't working. Instead of displaying the caption in my XML i get this instead; "level0.main.bubble".
When i click an image i want to attach a animated movie clip with that image, i tried attach movie for that concept and its working fine, but i want to remove that animated movie clip when the same image is clicked again, how to check whether the animated movie clip is attached with the image
you can take a look at www.mnet.co.za I'm trying to achieve the same effect. Can one attach mouse movements like "mouse over" / "mouse off" with a movie?
I'm trying to make a portfolio page where each of my thumbnails loads with the 'fading grid' effect. I've made all the thumbnails movie clips with the appropriate script, and they all work fine. I've also set them to be exported for actionscript, each with a number as their name, i.e. "1" "2" and so on.
I was then planning on using the following bit of code to load these movies into my portfolio clip, to save me having to do it at author-time.
[Code]....
But for some reason, instead of loading two movies, each one 10 to the right of the previous movie, it just loads them on top of each other. Is it something to do with the stage not updating?