ActionScript 2.0 :: Procedural Object Naming - Create Rectangles Inside The Clip
Mar 20, 2006i have a function that creates a movie clip and then procedurally creates 10 rectangles inside that clip.
[Code]...
i have a function that creates a movie clip and then procedurally creates 10 rectangles inside that clip.
[Code]...
i've got 48 small movieclips named "1clip", "2clip", etc. all the way up to "48clip." I want to do something with them all and use a loop to affect them all the same way.
[Code]...
but that doesn't seem to work. are variables and instance names interchangeable? my lClip var traces out of course, but the lClip.imagHolder.loadMovie never happens (clip inside the clip).
I have the following AS code to draw a single rectangle using mouse, but I need a different code that allows drawing multiple rectangles and the selection/exclusion of individual rectangles like a modeling tool (eg.: MS Visio).
View 2 RepliesI need an algorithm to place a set of N rectangles inside a circle for radius R, so that they can scaled up to the biggest possible size that doesn't exceed the border of the circle.
View 1 RepliesIs there a way to add a grid of rectangles together so that you can get a "container" rectangle (the bounds) of all the rectangles put together?
View 1 RepliesHow do I move / create a button that functions inside a movie clip?I have been creating a quasi-simple website following the tutorial provided by Lynda.com. Using I have created a functional site in which the buttons work so long as they are part of the main timeline. However if I take this functional button and drop it into a movie clip I've created, it ceases to function. Drag it back out of the movie clip and it starts working again. I am sure it's an action script coding problem on my end.[code]
View 2 RepliesI have a problem with a button.It has 4 keyframe and a text field with the same instance name "myText".I use this button in a MC, and its instance name is "myBtn".I'm trying to change myText with actionscript in the MC without any results.Debugging it I find a text field insiede this button named "instance6", so i think there is some problem with instance name.
I trying with:
trace(myBtn.myText);
and it says "undefined"!
How can i correctly give instance name to this text field?Is there any way to find out the name of the instance of an object (the text field) knowing the instance name of its parent (the button)?
I have mcA ( movie clip and instance name is mcA). in mcA there are two new movieclips whick i added - mcB and mcD (simple colored square movieclips).
We want if mcB hit mcD to hittest it and add for mcB some function like:
_x-=3
the problem is i dont know the as code for it to work.my code so far is this [code]...
I have four animated buttons with a design element cross_mc inside of another movie clip content_mc. I need all four buttons to be in front of the cross_mc so I get inside of content_mc to arrange the buttons accordingly (Modify > Arrange > Bring toFront). Everything looks hunky dory until I test the movie in which one of the buttons appears to be always behind of the design thingy no matter what I do...
View 9 Repliesor some reasons i need to create var dynamicaly.
Exemple
I have first an Array wich i want to use to "compose" my vars names
myArray:Array = new Array("aa","bb","cc");
In my final project this Array is created from a xml.
I want to do something like this, but doesn't work...
var ["myvar" + myArray[0]]:Sound = new Sound();
var ["myvar" + myArray[1]]:Sound = new Sound();
var ["myvar" + myArray[2]]:Sound = new Sound();
[Code].....
A lot of people have .com websites & put all their classes & packages inside a com folder & then their website name to avoid any possible naming conflicts when using other peoples classes - all very sensible. I have a .co.uk website however - is there an equivelant naming standard?
View 3 RepliesI have a project that requires manipulation of a movie clip (swf file). This clip is called clip_mc.I have functions such as:[code]If I add to the stage the swf and call it clip_mc, then everything is fine and it all works - BUT I have a few of these files that need to be loaded when the button is clicked.I understand the loader() class and the addChild class but cant get my head around bringing them all together!so essentially I would like to know; How to dynamically load the swf and name it clip_mc so that the functions will work?!
View 2 RepliesThis is the object array target structure I am looking to create
myObject.myArray[0].data=value;
myObject.myArray[0].data2=value2;
myObject.myArray[1].data=value;
[Code]....
I'd like to make an object that has it's properties named by constants from another class but can't quite get it to work. I'd essentially like to do something like this:
var myObject:Object = {Event.OPEN:"value", Event.COMPLETE:"value2"};
This syntax causes compiler errors.
First error is in the BtnRmc 1061: call to a possibly undefined method gotoAndPlay througt a reference with static tipe.. ..:Stage
PHP Code:
package import flash.display.MovieClip; import flash.events.Event; public class Main extendsMovieClip { private
[code].....
i need help about how to create an object container that contain TextField,movie clip, etc
[Code]...
In AS3 I would like to set the key of a shared object with the contents of a string as opposed to specifically naming the key.
so.data.test = "andy" // this is the basic working system
I do not want to write test I want something like this
// this is a non working and incorrect solution but shows what I am trying to do.
String myKey = "test"
so.data.{myKey} = "andy"
In Flex 3, MX effects could be triggered like this:
<mx:Resize id="myEffect" />
<mx:Button mouseDownEffect="{myEffect}" />
In Flex 4, Spark effects are triggered like this:
protected function onClick(event:MouseEvent):void {
resizeEffect.end();
resizeEffect.play();[code]....
There might be small differences between mouseDown trigger and the click event, please ignore that, it's just an example.I'm not sure whether triggers would or would not work reliably for Spark effects. Maybe they would but I guess there is a reason why this possibility is not even mentioned in the official docs.
[URL]
At step four, it says to
4- Inside another Movie Clip named "Limits" place "Pads" and "Wall". Pads' instance name should be "Pads" and Wall's instance named "Border". We put the Wall and Pads inside the same Movie Clip, to use it to know when the ball collided. And we couldn't put everything together because the ball behaves different if hits the Wall instead of the Pads.
How do I create this movie clip and put the other movie clips "inside it"? Also, if anyone can find out, where do I put this movie clip? Do i put it at the same spot as the wall?
Im able to link to a movieclip inside a movieclipUnfortunately one of the movieclips now are a scrollbar and scroll. Now the actionscript isnt working?cal.onPress = function() {gotoAndPlay(2);message1.contentMain.message.total = unit1;
View 17 RepliesI would like play head of a movie clip to return to a certain frame of that clip so a MC inside it would loop. I now have: stop(); as the action.
View 2 RepliesI'm writing a card game in AS3. The artist I'm working with has produced (in Flash CS4) a single swf-file containing all the card graphics and animations. The structure of the fla working file looks something like this:
- Scene
- CardGraphics (Movie Clip)
- CardFront
- CardBack
- CardValueImage (Movie Clip)
In the program I create 52 instances of my Card class, each having a MovieClip instance created from the loaded swf. The idea is to set the frame of the CardValueImage MovieClip to correspond to the Card instance's suit and rank member variables. However, I can't figure out how I access CardValueImage and call gotoAndStop (or whatever method I will need to call).
[Code]...
I'm having problems with something somewhat simple. We're going to a trade show and needed a video that would randomly load a SWF clip on one scene, then I have the timeline move to another after a delay and then go to the next part to load an image, then I have it restart and do it again, for a never-ending looping video at our booth.
I'm running into an issue though, when it loops and plays the SWF for the 2nd time, the old content still remains and the new content plays over the previous one. I figured the issue was I needed to remove the previous clip before loading a new one. I found some code that I thought SHOULD work but can't seem to get it right.
[Code]...
I'm making a game. Rings are spawned at an interval (attachMovie) and pushed into an array. I need my character (on the root) to hitTest something inside of the clips in the array, because I have a motion tween with easing inside of my clip (up and down motion).
This is what I would think I would do to hitTest the array (assume this is in a for loop):
array[i].inner.hitTest(_root.char._x, _root.char._y, true);
It doesn't work. I can't access the inner clip if it's in an array.
I thought this was all sorted out with my last thread: actionscript.org/forums/showthread.php3?t=245657The problem re-occurs when I leave the home page and then come back to it. The video buttons work when site load up, but the buttons go dead after clicking another menu button leading me to another page and returning back to the home page. Several hours of dead ends leads me back here.
There are masked download links from the original thread with the fla files if anyone is interested in this latest puzzler. You can also check out the live page at binaryoptics dot com to see this for yourself. This site is in the middle of editing with a lot to go. I have got to get this nightmare fixed so I can finish this site.
I'm using a loop to duplicate a MC named MCbutton, which is all good.
[Code]....
I am developing an application with Flex for the GUI and Restlet for the webservices. I have a strange problem. I put my XML as a property on a generic object, and send it as part of a POST request. But in the Restlet webservice, this XML is irretrievable. How do I retrieve it? I tried initialising the received Representation object to a DomRepresentation, but thats not working. If I put the received Representation object into a Form object, then getFirstValue is returning that XML as a string! I noticed that the contentType of the HTTPService was application/www-form-encoded so I set it to application/xml and its not helping either. I use restlet 2.0m6 and here is the code snippet that I use -
[Code]...
ok so if i have an obect called square1 and an object called square2 and inside square2 i have hitArea... i want to use shapeflag to detect an absolute true hitTest on just the area of square1 not the bounding box.... i tried this code and it didnt work...
actionscript 2.0
ActionScript Code:
if (_root.square1.hitTest(square2.hitArea._x, square2.hitArea._y, true)) {
OK frame 1 new fla and I type the following code:
[AS]createEmptyMovieClip("clip1",0);
clip1.createEmptyMovieClip("clip2",1);[/AS]
I have tried over and over again to get this to work but it won't! I want to create an empty MC and then create anoth MC within the first!
I have 2 pages. This script loads up the mainPage_clip
var mainPage_clip:MovieClip = new mainPage_mc();
var diary_clip:MovieClip = new diary_mc();
addChild(mainPage_clip);
[code]....
The other page is diary_clip. I have a button inside mainPage_clip that i want to unload the mainPage and load diary. But if i add this script to the one above i get an error:
diary_btn.addEventListener(MouseEvent.CLICK,diary) ;
function diary (event:MouseEvent):void
{
[code]....