ActionScript 2.0 :: Positioning Grid Generation In Movie Clip?

Jan 24, 2007

Here's a chunk of my code:

Code:
//This function uses loops to generate the grid from the array below.
function drawIt(theMap)
{

[Code]....

Basically, it generates a grid from two movie clips which are just different coloured squares. It reads in generateMap function to decide whether it will be a red square or a white square. 0 = white 1 = red. (the reds are going to prevent a sprite from travelling on them)

Anyway, at the moment the starting point for generating this grid is at 0,0 of the movie clip. I want it to generate at say 150,0 so i can add a console on the left which can control a sprite around this grid.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Flash With A Grid Snap Function - Positioning Of Movie Clips

Aug 12, 2010

This is my first action script project and I'm having trouble with some positioning of movie clips that I can't work out. I'll post in the parts of the code that I think are relevant in hopes that someone may be able to see what I am missing. The problem is that according to my traces my gridSnap function should be working. The trace shows mc.y to have the correct value while the movie is running yet the mc's in question are appearing in the wrong spot (they appear at GRIDSIZE*gridNumber) in the movie. The problem only manifests itself in case one and case three, both of which should have the same code but I was only testing different approaches in case one. On with the code:

[Code]...

View 3 Replies

ActionScript 2.0 :: Batch Movie Clip Generation?

Mar 4, 2002

is there a way in flash by which i can create a large number of movie clips in a single go instead of applying a loop and using duplicateMovieClip in every iteration.

View 3 Replies

ActionScript 2.0 :: Positioning Movie Clip?

Sep 25, 2007

In the following code when my movie first starts I want all my movieClips to be 25 pixels appart from each other no matter what the width of the mc. In the function "thumbnails" I can't seem to get my images to be seperated by 25 pixels on start up.I also want to set the y position of each movie clip so each image is seperated in the y direction by varying amounts but not to excede maxY amount. I haven't built that in yet. I am just trying to get them seperated in the x position by the correct amount.

Code:
cliparray = [];
function loadXML(loaded) {

[code]....

View 3 Replies

ActionScript 2.0 :: Dynamic Positioning Of The Rollover Images In A Movie Clip?

May 10, 2006

i have a movie in which i have 50 thumbnails dynamically added to a mc and i have a scroller to scroll the mc which works fine.. on each thumb i have a rollover image (which is a bigger image of the thumb) which works fine but i want the rollover image to be shown within the area of mask area which is not happening now..

View 4 Replies

ActionScript 2.0 :: Movie Clip Positioning Based Off Textfield Width?

Aug 13, 2006

I have a text field on the left and a movieclip butted up to the right of the text field. How can I move the movieclips position left or right based on the text fields width?

View 3 Replies

ActionScript 2.0 :: Positioning Image With Sliding Grid

Feb 17, 2005

Scene: 450 px width. and the boxes (instance name:dot) are 50 px each.
The AS on the timeline:
// IMAGE

PHP Code:
gridx = 60; gridy = 60;
num = 0; mcArray = [];
dot._visible = 0;
for (var i = 0; i<21; i++) {
for (var j = 0; j<1; j++) {
var mc = dot.duplicateMovieClip("dot"+num, num);
[Code] .....

And when It start to slide after a little time the images start to stack on top of each other. How can I solve this ?

View 3 Replies

Make A Grid With Different Frame For Each Movie Clip?

Jul 5, 2009

I am trying to make a grid with different frame for each movie clip

function dup() {
var maxNum = 7;
var Col = 4;

[code].....

View 7 Replies

ActionScript 2.0 :: Flash 8 Grid Layout Thumbnail Positioning/movement?

Jan 2, 2006

I am working on my very first flash application and have found these forums very helpful so I have decided to post here since I'm stuck. I have taken the thumbnail gallery ikim posted on this thread and im trying to tweak it to my needs. When the thumbnails are loaded i would like to implement an onrelease function to tween the image to the middle of the screen, then slide to the right and increase the size. I have written the actionscript that will move the image. However, my problem is, i need to have the thumbnail slide from its original position to the middle of the screen. I thought i could do this by passing the parameters of _x, _y in the function and setting the motion accordingly. Being a newbie to AS, I am having trouble with getting ikim's gallery to accomodate this functionality. I tried using getproperty to get the _x, _y coordinates but this only returns the coordinates for the beginning position of the image and i need the ending position coordinates. I assumed I need to call getproperty at a later time, but I am not sure how to reference the thumbnails since it appears to me that they are being dynamically named and created the same.

View 1 Replies

ActionScript 2.0 :: Display Instances Of Movie Clip In A Grid Pattern?

Feb 10, 2009

I want to load a range of images (20-30) each contained in a movie clip, and position them on the stage in a grid (table) format using actionscript. These images will be loaded from an XML file to make updating them a simple task in the future.

I have followed a tutorial to produce a "carousel" and this allowed me to have as many images as I wished loaded by the actionscript. I am sure that it is possible to have the items arranged however one would like provided you code the script correctly, and this is my problem. I cannot work out the correct code to get the movie clips into the desired arrangement.

how to position the items in various arrangements/patterns. I do not want a scrolling thumbnails solution. I want them to be multi-row/column.

View 1 Replies

ActionScript 3.0 :: Display Instances Of Movie Clip In A Grid Pattern?

Feb 10, 2009

I want to load a range of images (20-30) each contained in a movie clip, and position them on the stage in a grid (table) format using actionscript. These images will be loaded from an XML file to make updating them a simple task in the future.

I have followed a tutorial to produce a "carousel" and this allowed me to have as many images as I wished loaded by the actionscript. I am sure that it is possible to have the items arranged however one would like provided you code the script correctly, and this is my problem. I cannot work out the correct code to get the movie clips into the desired arrangement. how to position the items in various arrangements/patterns. I do not want a scrolling thumbnails solution. I want them to be multi-row/column.

View 1 Replies

ActionScript 2.0 :: Positioning Clip Based On Loop?

Feb 11, 2009

how do I set this onLoadInit so that with every new load it moves the _x of the container it's loading into (photoBox1 2. 3...) by the width of the parent container (picCont).Another option would be to include that picMCL right within the loop but I don't know how to pause the loop until onLoadInitis reached and new photo can be loaded.

[Code]...

View 9 Replies

IDE :: Positioning The Movie Clips?

Jan 16, 2009

I have five rectangle shaped movie clips....I need to change their _y position randomly by clciking a button..but there must be 10px space between them... so how do I modify the code to do it ?

PHP Code:

myArray = new Array(m1, m2, m3, m4, m5);for (i=0; i<=myArray.length; i++) {_root["m"+i]._x=400;_root["m"+i]._y=Math.floor(Math.random()*300)+20;} 

View 6 Replies

ActionScript 2.0 :: Positioning Movie Clips [resizing]?

Oct 4, 2006

I've looked in many places and still haven't found a solution to my problem... how his content stays positioned even after you resize your browser window?

View 1 Replies

ActionScript 2.0 :: {MX} Positioning A Loaded External Movie

May 30, 2003

I have a flash movie that has an internal movie clip, when the various buttons are pressed I want to load a movie in place of this original so I have put this script one of the buttons:

[Code]...

However, the new movie is not positioned in the correct place ie - instead of it being in the same position as the original MC the top left corner is positioned in the middle of the stage.

View 1 Replies

ActionScript 2.0 :: Positioning Movie Loaded In _level1?

Oct 19, 2002

I have tried everything to get my movie loaded in _level1 to be positioned correctly. The movie always jumps back to the top left corner.

Here's my code:

stop();
unloadMovie(1);
loadMovieNum("1dictate.swf", 1);
_level1._x=random=(164.3);
_level1._y=random(111.4);

Everyone says the code is right, but it doesn't work!

View 5 Replies

ActionScript 2.0 :: Positioning Screwed Up When Flash Movie Inside Another?

Mar 26, 2010

I have the positioning for a movieclip set via _x and _y parameters. It works fine when I publish and test just that flash file with the movieclip in it. Problem is, this flash file is embed inside another. Once I load the main flash file, the _x and _y are relative to that parent file.

View 1 Replies

ActionScript 1/2 :: Targeting A Movie Clip Inside A Movie Clip Inside Another Movie Clip With A Twist?

May 9, 2010

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 Replies

ActionScript 3.0 :: Flash - Movie Clip To Play Unless The Person's Mouse Curser Is On The Movie Clip For More Than A Second

Jun 24, 2010

I am pretty new to ActionScript 3 and Flash. I don't want my movie clip to play unless the person's mouse curser is on the movie clip for more than a second. If the person just runs their curser over the movie clips really quickly, then it should do nothing. It must be more than a second. How do I code that?

[Code]...

View 17 Replies

ActionScript 2.0 :: DropTest - Check And See If The Dragged Movie Clip Is Completely Within The Bounds Of Another Movie Clip

Jan 11, 2010

I'm creating a small drag & drop activity, and I want to be able to check and see if the dragged movie clip is completely within the bounds of another movie clip (or at least in the bounds of a certain x/y zone on the main stage. I can't use dropTest because it returns true if any tiny bit of the movie clip overlaps with the dropTest movie clip.

I also thought of something that just checks the x/y coordinates of the dragged movie clip, but I'd need this to reflect a range of values rather than one coordinate. For instance, I'd want to return true if the movie clip's x is between 50-60 AND the y is between 50-60. I'm attaching a small graphic to illustrate in case my explanation isn't clear enough [URL]

View 3 Replies

ActionScript 2.0 :: On Button Release Clear Current Movie Clip And Bring In New Movie Clip

Feb 21, 2010

I have created a flash website, each button is a movie clip with an invisible button over it containing the following script

on (rollOver) {
_root.mouse_over_profile_btn = true;
}
on (rollOut) {

[Code]....

each page is also a movie clip and on release of a button its played. the problem is that when i press another button to play another movie clip 'page' the old content is still there.

Is there a way of reversing the page transition i have used to bring out the movie clip and then bring in the next movie clip.

View 0 Replies

ActionScript 2.0 :: Collision Detection - Goto A Certain Scence When A Movie Clip Collides With Another Movie Clip

Jun 22, 2005

i am making a pacman game, and i need to know how to make it go to a certain scence when a movie clip collides with another movie clip.

View 2 Replies

ActionScript 3.0 :: MCs Classes - Can't Send An Event From The Eagle Movie Clip Or The T2D Movie Clip To Tell The Other To Fade Out

Nov 5, 2010

There is a bad gap in my knowledge with Event Dispatch and Event architecture, and this problem proves it. I've been getting nowhere on this problem for two days, I've posted everything to my Flash site. Go here, please: [URL] Click on "Flash Banners" The two thumbnails represent two different classes. Each class is identical. Both are "extends Movie Clip" classes. Tweeners of various types control the hover and click methods. URL Loaders load the thumnails which I then wrap in MC's and make them buttonMode = true, etc. Hover and click to load the Banners on the thumbnails.

I can't send an event from the Eagle movie clip or the T2D movie clip to tell the other to fade out. Both Banner classes are instantiated through a separate Base class. I'm sure this has to be an Event Dispatch from one MC to another and that it can't be done by the Base class. how I can send an Event or Event Dispatch and what the code structure is so one movie clip can in one class can tell the other movie clip in the other class to disappear while it's neighbour is playing. I'm happy to post code or explain / clarify anything that's not clear.

View 1 Replies

ActionScript 3.0 :: Movie Clip On Main Timeline Receiving Input From Nested Movie Clip

Feb 23, 2011

I've got a main timeline .swf file called "blank.swf" which contains nothing but two blank movie clips one called called "pproduct", the other called "ppalette". In the script frame of this main timeline I use the simple "Loader = new Loader();" method to load a URL of an .swf file into the "ppalette" movie clip. The "ppalette" movie clip contains several color chip buttons, each of which use the same Loader method above to load an external .swf into a clip. Here's what I want to do: let those color chip buttons, when the "blank.swf" file loads, be used to load an .swf movie into the "pproduct" clip on the main timeline. I'm wanting to be able to swap depths with various movie clips which will take out the movie which has the palette, but I want whatever that palette has loaded in the original "pproduct" clip to stay there.

[Code]...

View 3 Replies

ActionScript 2.0 :: Get A Movie Clip To Slowly Move To The Coordinates Of Another Existing Movie Clip

Oct 23, 2010

it seems simple enough but i have no idea on how i could get a movie clip to slowly move to the coordinates of another existing movie clip

View 5 Replies

Professional :: Create A Smooth Transition From End Of A Movie Clip To Beginning Of A Movie Clip?

Apr 8, 2012

I created a movie clip which plays ok. But when it ends there is a slight jump, if you will, when it goes back to frame 1 to begin playing again. Does anyone know how to make the transition unnoticeable from the last frame of a movie clip to the first frame of a movie clip?

View 4 Replies

ActionScript 3.0 :: Make A Movie Clip Follows Anther Movie-clip That Could Be Moved By User?

Sep 7, 2010

iam tring to make a new project , i just wants to know how to make a movie clip ( constant speed ) follows anther movie clip <--- "which can be moved by the user "

<<<>>>> i believe that this idea is good , that i records the X and Y postion of the User's movie clip and just make the other movie clip points at this postion and move toward it ,

how to make the other Movie clip (( which is a car ! .. so it have acceleration , speed , steering , etc )) go to this position or let us say try to??

View 9 Replies

ActionScript 2.0 :: Find The X-y Coordinates Of The Attached Movie Clip Within The Created Movie Clip?

Mar 26, 2006

Q1) The registration point of a created clip is top left - my question is how can I dynamically change it's registration point - say to center center?

(I am trying to attach a movie clip to a created clip and I wanted it to be centered inside the container - a related sub-question, how can I find the x-y coordinates of the attached movie clip within the created movie clip?)

Q2)When I tried to create two different movie clips, I found I had to create them at different depths, else the first would load and the second would not. Why would that be so? I'm on MX 2004 Pro.

View 4 Replies

ActionScript 2.0 :: Actions On Movie Clip Inside Another Movie Clip (menu) Won't Work

May 15, 2009

I have a very simple problem but I can't find the very simple solution to it. I've create an animated menu with animated movie clips inside to work as buttons. All the main buttons work perfectely but I've got just on button with a sub-menu. On this sub-menu I've placed an invisible hitarea button in order to place some gotoAndStop action. The thing is, it seems to me like this submenu hitarea are underneath something else (even though is the seccond layers right about the actions layers). I've placed a simple trace action whenever the mouse rolls over this area but I get nothing... Am I doing something really wrong? I'm losing all my hair already.

View 2 Replies

ActionScript 3.0 :: Resizing Parent Movie Clip Affects Child Movie Clip?

May 27, 2009

i am trying to use the Tween class to change the size of movie clip to certain height.the code works for me but when resizing the parent, it effects the child.i tried the height and scaleY property for the thum, but does not work.

ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

[code]....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved