ActionScript 2.0 :: [Flash8] Use Many Copies Of One Instance To Build The Visible Part Of Maze?

Aug 1, 2006

I am writing a maze program for school. I am using a 2d array to represent to location of walls for the maze. The background (for figuring out where a player can move) is not the problem.I am using this algorithm for places the images...

for (i = 0; i < 22; i++) {for (j = 0; j < 16; j++) {if (maze[i][j] == 1) {instanceName = "wall" add i add j; //for multiple names for each instance
duplicateMovieClip("wall", newname = "instanceName", 1);
setProperty("instanceName", _x, (25*i+13));

[code]....

What needs to be done to use many copies of one instance to build the visible part of my maze? I want to be able to have all pieces anmed "wall" instead of "wall1", "wall2", etc...which isn't working anyway.

View 5 Replies


Similar Posts:


ActionScript 1/2 :: Adressing Multiple Copies Of Movieclips With Same Instance Name

Jun 13, 2009

Is it possible to iterate through MV copies with the same instance name? It would be very useful for my project.

View 5 Replies

ActionScript 2.0 :: Use LoadMovieNum To Load A Part Visible Swf?

Dec 15, 2009

I was build a ComboBox, and it's working ok. Im choose an option, and movie is loading to stage, but its load with full workspace that was previously exported. How i can hide everthing about my animation ? I have several animations in different size.

And second question, how make position of the animation on the stage ?

This code is putted to ComboBox and does not work: (also i was try put this. before _level1._x, but when i was choose an option, menu was moved to the x,y position.[code]...

View 0 Replies

ActionScript 3.0 :: Build In A Start Time For A Part That Isn't Loaded Yet?

Oct 31, 2009

I am creating a flv player and sofar so good. But now I want to build in a start time for a part that isn't loaded yet.Currently you can click a spot in the progress bar, however if that part is not loaded yet it will simply jump to the end of the loaded bar instead of starting to load at the clicked point.i.e. I have a video of 1:45, it's loaded for 0:30, however I want to start playing at 1:00. Howe can I create this? I cannot get it to work with seek(70) as it still jumps to seek(30) (as this is loaded);

View 3 Replies

Flash8 :: Music Only Plays For Part Of Song?

Nov 30, 2009

I've got a flash website that I've been using a little while nowIt was created for me, but I know enough on how to edit itHowever, I recently decided to add new music instead of the regular loops used beforeI added three full mp3's to the library and they are on the site and allbut it cuts off after the first minute of the song and it starts over

View 10 Replies

Actionscript 3 :: Adobe Flex3: Make A Part Of Application Visible On Showing Modal Popup

Oct 6, 2011

For example: Say the application has two VBox with vertical layout. There is a Button in first VBox and when clicked, there is a custom modal popup being shown. By default the whole background of the application remains blur, but I want the second VBox to be visible. Is this possible? If yes how can i accomplish this?

View 2 Replies

Flex - Build Efficient Button Skins With Larger Hitareas Than Visible Area?

Aug 3, 2011

What I'm trying to do: build a super simple button skin (say a small circle when in up state, slightly larger circle when in over / down states) that has a larger mouse hit area than visible area. In other words, I'd like the button to look like a 5x5 circle when in up state, but transition to over state when the mouse is in a 15x15 pixel area around such circle - in order to make clicking on the button easier.

What I've done in the past is to use a transparent ellipse behind the the visible ellipse. This works nicely but seems like a waste of memory (not much, although if you start having a lot of these buttons it adds up) and rendering cycles (transparency). I thought I could avoid this by wrapping the ellipse in a group with a given size and listen to its mouse events, but somehow no mouse events seem to fire on such a group - not sure why.

I guess I'd love to know if anyone knows an efficient way to do this. Also would love to know why such a group won't fire mouse events, but I guess that's secondary. Simple code snippet below:

[Code]...

View 1 Replies

ActionScript 3.0 :: Using CurrentTarget As Part Of Another Instance Name

Jun 20, 2010

I'm new to AS3 and was wondering how I can use something like:
var mc:MovieClip = MovieClip(e.currentTarget);
As part of another instance name.
For example if the currentTarget was a move clip with an instance name of "oneNav" and then I wanted to control a movieclip with the name of "SuboneNav", how could I do it? All the variations of concatenation I'm familiar with weren't working. I even tied getting e.currentTarget.name instead but there always seems to be an issue.

View 5 Replies

ActionScript 2.0 :: [FMX] Subtract Part Of Instance Name In Function

Aug 1, 2004

I have the following code from a tutorial on Kirupa:

Code:
_root.currMovie = "home";
container.loadMovie(_root.currMovie+".swf");
_root.home.gotoAndStop(2)

[Code]....

As you can see are the button names: home, about, service and contact. This are also the names of the external swf's. But now I have chanced my button names in: btn_home, btn_about, etc. Now is it a little stange to name my external swf's btn_home etc, so how can I substract the prefix btn_ from the buttons so that the externa swf's can keep their normal names? I know it has something to do with substr but I don't know how and where to implement it.

View 3 Replies

ActionScript 2.0 :: Grabbing Part Of An Instance Name And Using As A Variable

Jun 11, 2005

I have 36 buttons on my stage that are named [thumbBut0, thumbBut1, thumbBut2,..., thumbBut35]. Each button is a thumbnail image. I want to have it so that when the user clicks on a given thumbnail, the full-sized image corresponding to the thumbnail gets loaded and viewed...yada, yada, yada... So, if the user clicks on thumbBut25, the 25th image gets viewed...

My question: is there some cool way that I could avoid writing 36 different (although they would be similar) "_level0.thumbButXX.onRelease = function()..." type things for each of the 36 buttons. In other words, when the user clicks the instance "thumbBut25" something grabs the "25" part out of the instance name, converts it to an integer, and passes it on to a function that loads up the image that corresponds to "25"?

View 3 Replies

ActionScript 2.0 :: [FMX]Substract Part Of Instance Name In Function?

Aug 1, 2004

I have the following code from a tutorial on Kirupa:

Code:
_root.currMovie = "home";
container.loadMovie(_root.currMovie+".swf");

[code]....

View 3 Replies

ActionScript 2.0 :: If (rollover Instance 'imgsmall' ) Then Display Visible Instance - 'imglarge' Then Rollout Then Do Not Display 'imglarge'

Feb 21, 2008

how do you do this...if (you rollover instance 'imgsmall' ) then

display visible instance 'imglarge' then

rollout (instance 'imgsmall') then do not display 'imglarge'

View 2 Replies

Actionscript 3 :: Canvas Total Width (visible Width + Hidden Scrollable Part)?

Apr 19, 2010

It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial.

I have a Canvas control with a fixed width and a horizontal scrollbar.I'm trying to find the actual width of the control.The .width (fixed width) + the part being revealed by the scrollbar.I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot.

View 1 Replies

ActionScript 2.0 :: Flash8 Variable From Instance Name?

Sep 5, 2009

I've got these 150 buttons on my stage which all do the same thing. They test their value against myVariable to see if there's a match. If there is, it's a right answer and the user gets a point. The myVariable may be anything between 1 and 150. I have my button code on a single frame now but I'm looking at duplicating it 150 times (1 for each button instance). This seems a wasteful way of doing things. Is there any way I can extract a variable from the instance name? The buttons named btn1~btn150.

Is there any way to:
btn 1~150 onRelease
var newVariable = [instance name - "btn"]
I guess this requires some way to listen for an instance name.

View 3 Replies

ActionScript 2.0 :: Flash8 : Dynamic Instance Naming Of MC's?

Jun 5, 2009

I have 4 Mc's on the stage, and they have instance names 'mc1' - 'mc2' etc.The MC's have links in them (they are kind'a navigation items) and i need to change the functions of the 'rollOver, and mouseDown events', but keep the MC's the same.The MC's are referenced by instance name and given functions in the first few frames of he movie. for example

---------------
mc_1_0.onRollOver = function() {
if (_root.mc_1_0._currentFrame == 1) {

[code]...

Now, what i want achieve is to change the instance names of the MC's (mc_1_0 for example) so that when the user interacts with this MC on the stage, they are taken to locations of my choice (and the actions of another MC), by switching the instance names. IE, i want to change the instance name of 'mc_1_0' to 'mc_2_0' at runtime, BUT i want to do it with a variable from a .txt file.i would need to start with a script that looks for the MC with a certain instance name

-- look for instance mc_1_0, and then change the instance name to 'mc_2_0'

The effect would be that the user would instigate the same actions, regardless of which of the two MC's they rolled over.Maybe i could call the instances initially 'MC_1_Temp' and 'MC_2_Temp' etc: and then i would need a script to change them to 'mc_1_0' and 'mc_2_0' at runtime.SO in the text file i would need something like this

--------------------------
&MC_1_Temp_name=mc_1_0&
--------------------------

this way the behaviour of the MC on the stage wil take on the functions of another MC.should i be looking at something like this placed on the MC.....

onClipEvent(load){
//make this instance called - var = MC_1_Temp_name
}

View 3 Replies

Flash8 :: Add Variables To A MC From The Action Layers, Using The MC Instance Name

Sep 11, 2009

I've read on the net that actionscripting from the action layer will result in a more readable file once published, as apposed to attaching onClipEvent functions which slow down readability.

For this reason I am trying to add variables to a MovieClip I have on the stage with an Instance Name of Player. However I wish to assign the MovieClip variables from the actions layer using the MovieClips Instance Name.

[Code].....

View 5 Replies

ActionScript 2.0 :: [Flash8] Using Symbol And Instance Names

Jul 10, 2008

I'm building a platforming game using AS2. I just got collision detection working between my character and multiple instances of an object. the different collisions (top, left, right, and bottom of platform blocks) are determined by a single symbol with 4 instances named for the different sides. this is good if i only want to have one block. is there a way to reference the symbol name in the actionscript or to have multliple instances of the same name to actually work?

View 1 Replies

ActionScript 2.0 :: Flash8 : Return The Index Of The First Instance Of A Specified Value Within An Array?

Apr 29, 2009

Is it possible to return the index of the first instance of a specified value within an array? Similar to:

Code:
var my_string = "string";
var index = my_string.indexOf("g");

/*Outputs:

1
*/

Basically, I have two arrays, each with 10 values (in slots 0-9 of the arrays). So I need to see if an array has a specified value in it, but then I have to see if the other array has a certain value in it, in the same spot as the first instance of what I search for in the first array.

View 4 Replies

Add Lazers To A Maze Game?

Jan 7, 2011

I've just finished making a maze game similar to the "Scary Maze Game" and would like to add lazers around the maze to make it harder to get through.

So basically when youre mouse cursor hits the lazer you lose, id like the lazers to either swing side to side or just appear every X amount of seconds.

View 8 Replies

Actionscript 3 :: Hit Testing For A Maze?

Apr 21, 2011

I am making a maze game and i have the edge of the maze as a movieclip. I'm trying to test if the player hit tests the maze to make him stop using this code.

If(player.hitTestObject(Maze))
{
function()
}

But wether or not It's actually touching the maze (it's in the empty space on the inside) it always registers as touching.

View 2 Replies

Create Flash Maze Game

Mar 10, 2011

I am creating a Simple Flash Maze Game,and i have 2 'Movie Clips' that i want to react when the collide.IE. When 'CHAR_LVL1' (A Movie Clip, controlled with the Arrow Keys) comes into contact with 'WALL_LVL1'. I want it to 'gotoAndStop(27);'[code].I am using Flash CS5 and Action Script 2.0

View 1 Replies

ActionScript 2.0 :: CS3 Hack-proof Maze Game?

Jul 22, 2009

I'm making V.2 of a maze game I made a while ago [URL] I want this version to be unhackable only I can't find any tutorials

View 2 Replies

ActionScript 3.0 :: Developing A Flash Maze Game?

Feb 13, 2009

I am developing a flash maze game and I have a problem with changing direction of my movie clip. I can move around my maze and I have a hit test sorted. But what I want is when a player presses a keyboard button, the first animation of the MC rotating will be played, then when the play head hits stop the MC will stay in this same position (pos from last frame) until another key for example up is pressed.

[Code]...

View 1 Replies

ActionScript 3.0 :: Simple Maze Game (Pac Man Style)

Jan 29, 2010

I want to create a really basic pac man style maze game, its actually for some marketing materials and it will be really used as means of navigation rather than as a game, I want pac mac to eat certain words and when that happens it will tell the user about that topic. What the best way for pac man to work his way around the maze would be? Would I be best using hit detection? Also what would be the best way to remove the pellets as he eats them? visibility or remove child?

View 3 Replies

ActionScript 2.0 :: Make A Maze Game Teleporter?

Apr 24, 2005

I'm making a maze game and i want to make a teleporter so that when my mc hits it he goes to a certain coordinate?

View 2 Replies

ActionScript 3.0 :: Multidimensional Arrays - Maze Is Not Being Displayed Correctly?

Feb 6, 2010

I have some working code that I created in C and ported over to the PSP. I decided that I wanted to work with it in flash and ported it over to AS3.0. It took me a bit to get used to the graphics commands but over the course of a few days I managed to get the code typed in. I compiled it and watched my baby come to life in a new environment. But there was something wrong, everything looked correct but felt wrong. I looked closer and saw what the problem was. The maze is not being displayed like how I put it in.First let me give you some visuals to look at.

[Code]...

When I run the program this is how flash displays the mazeThe starting position is the bottom left corner. Which in flash terms is 13,1. Why oh why is flash rotating and then inverting the map? If row = 13 and col = 1, then [row-1][col] should equal 12,1. I've broken it down and analyzed it till my brain hurt... I can not find any reason for this bizarre behavior... All the program does is interpret the 1's and 0's to know where to place a wall. If the square has a 1 then a wall goes there, if not then its open and the player can walk there. I look at the surrounding squares and then draw what I see... no rotating and no inverting is done.I remind you that the code works as intended in C. So I don't think its a coding issue.

View 10 Replies

ActionScript 2.0 :: Make A Maze That's Not Made Of Square Blocks?

Apr 2, 2004

I'm trying to make a maze that's not made of square blocks,The little guy in the left-hand side moves when the user presses an arrow button, but when he can't walk through the lines (walls)I'm guessing that I can't use the usual "hitTest" command, so is there any way i can achieve this without finding every point where the lines cross and do a specific hitTest (hitTest (x,y,true) )?

View 3 Replies

Multiple Copies Of The Library Panel?

Nov 6, 2009

I've used the New Library panel to copy symbols from one Flash document to another & subsequently closed the extra Library panel. I did this twice for on different occasions.
 
My Library panel is usually docked & collapsed so ocassionally I use Crtl-L to expand it. Now, when I do that, the previous 2 extra Library panels also appear & I have 3 Library panels on the screen - 1 docked & 2 extra floating ones! How do I get rid of the other 2 for good?

View 2 Replies

Flash - AS3 CPU Performance With 100 MovieClip Copies

Aug 16, 2010

I have a movieclip wich has a simple movement of a simple shape. This movieclip is copied many times to create a graphical effect. As the number of copies, or the complexity of the movieclip increases, CPU usage goes up. As from 90 copies, when I keep moving the mouse over the swf movie in a circle, playback stops (hangs). When the mouse movement stops, the swf continues again at the right position, as if calculation has continued, but updating the display has not. Now this is a quadcore pc, and we're 2010. I can't believe or accept that 100 mc's is the maximum number of movieclips that can be rendered. The obvious question is what can be done to optimize CPU performance ?

I'm using AS3, flash player 9.
Movieclip is a simple rectangle shape which moves along 1 axis.
var myLinkage:Class = Class(getDefinitionByName(getQualifiedClassName(McToRepeat)));
var newMC:MovieClip = new myLinkage();
containerMC.addChild( newMC );

View 1 Replies

Get Number Of Copies During Print In Flex?

Sep 7, 2011

Am working on the flex application with print option.

I need to check the print count[code]...

I attained the print count but unfortunately I can't get the

no of copies during print. When the user increases the no of

copies i need increment the PrintCount.

View 1 Replies







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