ActionScript 2.0 :: Hittesting. Special Rules?

Apr 23, 2006

are there any special rules regarding hittesting? im using this code here and its jus not working at all:

var speed:Number = 0;
var angle:Number = 0;
var angleFish:Number = 0;[code]....

im starting to get quite irritated

View 2 Replies


Similar Posts:


ActionScript 2.0 :: What Rules Are For Declaring Variables

Sep 17, 2007

I was wondering what the rules are for declaring variables which you would increment say in an for loop. I tried to declare a variable outside the for loop, and then increment it within the loop but that didn't work.

View 2 Replies

Detect Screen Resolution And Video Rules?

Dec 4, 2010

What are the rules for using encoded video in flash? If the video is 30fps does my flash animation have to be 30fps?

example of detecting the overall screen resolution and using it in a variable? [the resolution of the desktop]

View 3 Replies

ActionScript 3.0 :: Accessing Compound CSS Rules In SetStyle()?

Aug 2, 2011

how to use setStyle() for style attributes defined for a CSS class, but how can I change compound styles via actionscript? For example, my TabBar uses the following CSS style as part of the selected tab definition:

.myTabBar s|ButtonBarButton:upAndSelected {
}

I want to have a color defined at runtime, using setStyle() seems to be a solution there. Just don't know how to delve that deep in the levels of the CSS structure.

View 0 Replies

ActionScript 3.0 :: What Are Rules For Legal Variables Names

Feb 4, 2010

What are rules for legal variables names?ie: A-Za-z0-9, hyphen, underscore, etc. must start with an alpha at least n characters, no longer than n characters, etc.

View 3 Replies

AS3 :: Flash - Separate The Data And The Game Rules In A Model?

Dec 17, 2010

I feel like MVC misses a letter to describe the situation in a game. The model to me seems to consist of two distinct parts:

A group of vars that describe the current game state (these will have setters that send out events on change, and getters so that the view can access what changed)
The rules of the game that determine what happens once a certain input (i.e. shoot();) has been received by the controller (these will update the group of vars as deemed appropriate)

The view will exclusively be reading from 1 while the controller will be exclusively communicating with 2. This is why I make the distinction and want to divide them up into class1 and class2.

My questions:

I am unsure if I should be making this distinction, since I haven't seen it anywhere. If I should; should I make two separate classes, or should I extend class1 with class2? Finally, I am having trouble making sure that only class2 (and not the view) can change the variables in class1 (while still being able to send out an event when a value changes).

View 2 Replies

Media Server :: Firewall Rules To Secure Live Stream?

Sep 12, 2011

recently been dealing with a problem where outsiders have been able to hijack our Windows 2003 server based Flash Media Server 4 default livestream access point and bounce pirated television content over it. Currently am running this on a campus network and thought I had it locked down so that all incoming port 1935 requests must originate from campus and outgoing streams are served everywhere. This is sort of working, but it is also stopping legitimate traffic from streaming video to off campus visitors. If anyone can shed a light on how to setup my firewall rules that would be great, as I am stumped. Here is the list of how I've setup the rules (not using our real IP's for protection):
 
Campus is a class B network, everything is based off of 123.123.X.X
 
Server sits on 123.123.1.2
 
Port/rulename               Rule                   Local Port  Local IP   Remote IP     Remote Port
Port 80                     Allow TCP/UDP             80          ANY           ANY                ANY
Streaming out           Allow TCP/UDP OUT     1935        ANY            ANY                ANY <--this rule is supposed to allow all

[code]....

I've tried swf verify but thats easy to circumvent, nor can I get the allowhttpdomains options to work properly as it wants real names and not IP numbers.

View 19 Replies

Java :: Apply Mathematical Rules Stored In Database To A Variable Gotten From Human Machine Interface?

Jun 10, 2011

I'm developing a project with Flex, Spring, Hibernate, MySQL, Tomcat, but one of the functionality is: " i have to store a mathematical rule like for example " a+b " into database, then in my human machine interface, i have two fields when user write the variables "a" and "b", then a button with the label calculate which if it's clicked, it'll show bellow the result of applying the rule " a+b " to the variables "a" and "b" which the user previously." Now, i'm searching for an Java or Flex API or any other way that will give me the ability to apply a mathematical rule stored in database as string, to variables i got from human machine interface"

View 1 Replies

ActionScript 3.0 :: E.target For Hittesting?

Nov 9, 2009

I have a question regarding hittest object in actionscript 3. When using events, you can check what the current target is by using e.target or e.currenttarget. I was wondering how this achievable by hittesting?since hittests are not a function.

I need to retrieve info about the hittested object.Here is an example to make it more clear:

ActionScript Code:
if(movieclip1.hitTestObject(movieclip2)){
textfield.text = "this is information selected by the hittest: " + channel[e.target.name].item;
}

I'm working on a project and using hittest to navigate. So it's pretty important haha.

View 0 Replies

ActionScript 3.0 :: HitTesting An Array?

Nov 18, 2009

I have a movieclip named Map linked to a class named Map. Inside of the movieclip I have 3 instances of a movieClip hitbox. they are named block0, block1, block2. What I'm trying to do is add them to an array using a for loop. Then in my player class I use another for loop to hitTest against the array. What I'm getting tho is this error:

Code:
TypeError: Error #1034: Type Coercion failed: cannot convert []@2393159 to flash.display.DisplayObject.
at xxx::Player/loop()[Player.as:54] The code from Player.as that the error refers to is here:

[Code]...

View 3 Replies

Hittesting Odd Shaped Objects?

Sep 8, 2009

I created a .PNG in Photoshop (see attachment) -- now when I make this into a movieclip the bounding box covers the entire area so the hittest activates as soon as my helicopter flies into the bounding box.I looked at adobe's "help" they recommended this code (by the way, I'm using Flash 8):

my_mc.hitTest(x, y, shapeFlag )
my_mc.hitTest(target)

The way I interpreted the code was like this:

onClipEvent(enterFrame){
heli.hitTest(248.1, -38, shapeFlag)
}

I read somewhere that you only use one of the two, and the shapeFlag one is the one to use.The above code I placed into the helicopter MC (named heli) - I set the x & y to where the PNG is.The PNG moves towards the helicopter, so I'm not sure if that makes a difference.I just want that if the helicopter runs into the ceiling or floor, the level resets.However my current actions activate as soon as it hits the bounding box.This is my code in the PNG:

onClipEvent(enterFrame){
this._x -= _root.levelSpeed;
}[code]....

I've tried a lot of things, and nothing seems to be working.

View 5 Replies

ActionScript 2.0 :: Hittesting Two Or More Buttons?

Aug 12, 2003

iv gotten hittest to work on me and my friends sites, but with olny one button for the MC to check for. Very simply, how do i get it to check for 2 or more?

View 6 Replies

ActionScript 2.0 :: HitTesting MC's From Library?

Sep 5, 2010

I've got a game where I need the enemys to hitTest with each other, I'm going to have copys of 3 types of enemys on the stage, instead of giving them all an instance name is it possible to hittest from the libary because I've given them instance names in the library of "enemya" "enemyb" "enemyc"

The code I have got didn't work which was -

Code:

onClipEvent(enterFrame){
if(this.hitTest(_root.enemyc)){
trace("true")
}

[Code].....

View 5 Replies

ActionScript 2.0 :: HitTesting A TextField.prototype?

Aug 23, 2009

I'm looking to run a trace that targets all TextFields on a mouse over, something like this:

PHP Code:
TextField.prototype.hitTest = MovieClip.prototype.hitTest;
onEnterFrame = function(){

[code].....

View 2 Replies

ActionScript 3.0 :: HitTesting Multiple Array Elements?

Nov 19, 2011

I have a tile-based platformer game under work, and I'm stuck on a problem with hitTesting:
 
//check all character collisions with levelHolder
for(var i:int = 0; i < levelHolder.numChildren; i++)
{

[Code].....

The problem here is that hitBlock only hitTests one block at a time, and when I test this: If you lean on a wall (press right arrow key) and go downwards you can go through the floor.
 
I need to make it so that I can test on multiple blocks at a time.
 
And I did try to replace hitBlock with levelHolder[i], but it gave an error saying:
 
ReferenceError: Error #1069: Property 0 not found on flash.display.Sprite and there is no default value. at Main/enterFrame()
 
I'm guessing that comes from the level array where 0 = blank block / empty space.

View 7 Replies

ActionScript 3.0 :: Hittesting 1 Fat Sprite Or Many Smaller Sprites?

Jan 6, 2011

At first I had all my sprites in an array and cycled through them to detect for collisions but now I am trying to put them in 1 big sprite and testing just that. I don't know if I am doing something wrong or this is to be expected but testing for 1 big sprite creates lag within the engine. Am I correct to assume that it's because I am constantly testing the pixels of the 1 sprite? When cycling through the sprites individually i never noticed this lag.

View 0 Replies

ActionScript 3.0 :: Hittesting MovieClip Class Array

Oct 29, 2011

I am trying to make a basic game, and have read all about bitmaps, but they have only confused me, so I am trying to succeed with a more flawed, but basic approach. I couldn't find any comprehensible tutorials on this, so I've tried it on my own, but it doesn't work.Basically I have my character in a movie clip connected to a class, and it is spawned when the movie starts, just like the "wall" class here. It populates the stage with a line of boxes, but my problem is that the hittesting only works on the first one.[code]

View 9 Replies

ActionScript 2.0 :: Shapeflag HitTesting Not Working In Movieclip?

Mar 19, 2008

I thought maybe I had to use localToGlobal, but they are on the same layer, so it can't be that. It works on the root frame, just not in the movieclip.

View 2 Replies

ActionScript 3.0 :: HitTesting Between Two Arrays Of Differing Length?

May 5, 2009

I'm just learning so I'm sure I'm making many stupid errors. How do you hitTest 2 separate arrays of different lengths, all entries against one another . Code below for guidance.

Code:
package{
import flash.display.*;
import flash.events.*;

[Code]....

View 2 Replies

ActionScript 2.0 :: Hittesting Movieclip With Movement Inside It

May 11, 2010

I'm making a game where your character must touch rings (big ovals) that are moving up and down with a motion tween (with easing). I attach these movies and push them into an array. For the hittesting, nothing is accurate. Since a movieclip inside the ring movieclip is moving up and down, the boundary box is much bigger than it should be when hittesting. If I use the x/y method, it triggers the hittest when my character is in line with the reference point. It should trigger when the middle of the character hits around the middle of the ring.

View 2 Replies

ActionScript 3.0 :: Hittesting Irregular Shaped Objects?

Dec 16, 2010

What I'm trying to do is hittest two irregularly shaped objects using their alphas and not the bounding box.

The code below hittests two objects named target 1 & target 2. This is not my code, but mine looks exactly alike, except target 1 & target 2 are replaced with my MC's. the thing is, I keep getting an error.At every function line, like the "public static function complexHitTestObject I get an error that says: Expecting right paren before left-bracket. I don't know what this error is caused by, because I can't really see why Flash wants another right paren.

[Code]...

View 6 Replies

ActionScript 3.0 :: HitTesting Against Multiple Movieclips Within An Array

Feb 4, 2012

im having a really frustrating problem. I have 6 movieclips on the stage, all acting as 'map areas', these are named area1_mc, area2_mc and so on.. I then have a car which i drive around the screen, this instance name is car_mc ... All i want to do is do a HitTest to determine if the car is on one of the 6 areas.. i have the following

[Code]...

The reason it is not working i think is it is expecting the car to be on ALL map areas in order for it to be "on map". For example if the car is in the middle of area1_mc, i get three traces. On map (refferign to it being on area1_mc) then two traces of 'off map', because it obviously isnt on area2_mc or area3_mc.

View 14 Replies

ActionScript 2.0 :: Duplicate Multiple Movie Clip And Then Hittesting Them All

May 4, 2006

i'we tried for years to duplicate multiple movie clip and then hittesting them all but i can't this is my last resort

View 2 Replies

ActionScript 2.0 :: Advance HitTesting - Test The Collision If They Are Rotated?

Oct 27, 2006

it's easy to test collision between two squares. how do I test the collision if they are rotated?

View 1 Replies

ActionScript 2.0 :: Accurate HitTesting Updating Arrays With Collisions.F8 CS3.zip?

Apr 25, 2008

I have 4 ball movie clips, a playhead and four target movieclips called mc_1-4, the array, (my_array), has 4 elements, which are each defined as having values of 0: I have a hitTest set up that will trace my_array to the output window each time it hits mc_1, to see what is happening. However the hitTest prints the array 3 times?

Am i right in thinking that this is because the hitTest is being triggered on entry of mc_1 in the center and upon exit?I need to make this hitTest be triggered once when the hitTest passes the center of mc_1. Secondly if any of the balls have been dragged and dropped on to mc_1 i want the array value with an index of 0, to change to 100 from 0 (not in terms of its index position because my array is only 4 elements long, in terms of its actual value) which i have tried to implement but i cannot configure the right code.

1. hit tests that only trigger once when they pass through the center of the object thus tracing one array.

2.use the balls 1-4 to make the array index 0, have a value of 100 if they are in contact with mc_1.

View 4 Replies

ActionScript 3.0 :: HitTesting Edges / Moving Movie Clips Stage Length?

Dec 7, 2010

This is sort of a multi-layered question- I have a movie clip that I sectioned off in quadrants:The red dot is the player, the stage is the size of one square. My goal is to, when the player moves to either of the 4 edges, the next section of the quadrant comes up (meaning if the player moves to the right edge, the section that borders the right edge will slide on screen, and the old section will slide off screen).I was wondering if there was a way to hitTest if an object is touching any part of the edges? Is the hitTestPoint method something I should look into? What I have so far is an object off screen (black rectangle), that when the player touches the quadrants slide like I want them to (at least I'm trying to make that work).Here is my code. I know some of it's wrong and/or I'm missing something.

if(leftKeyIsDown && player_mc.x > -15)
//-15 is half the size of the temporary player_mc
{

[code]......

View 18 Replies

Php :: Special Characters In Flex?

Jan 4, 2010

I am working on a Flex app that has a MySQL database. Data is retrieved from the DB using PHP then I am using AMFPHP to pass the data on to FlexThe problem that I am having is that the data is being copied from Word documents which sometimes result in some of the more unusual characters are not displaying properly. For example, Word uses different characters for starting and ending double quotes instead of just " (the standard double quotes). Another example is the long dash instead of -.All of these characters result in one or more accented capital A characters appearing instead. Not only that, each time the document is saved, the characters are replaced again resulting in an ever-increasing number of these accented A's appearing.

Doing a search and replace for each troublesome character to swap it for one of the none characters seems to work but obviously this requires compiling a list of all the characters that may appear and means there is scope for this continuing as new characters are used for the first time. It also seems like a bit of a brute force way of getting round the problem rather than a proper solution.Does anyone know what causes this and have any good workarounds / fixes? I have had similar problems when using utf-8 characters in html documents that aren't set to use utf-8. Is this the same thing and if so, how do I get flex to use utf-8?

View 1 Replies

Php :: Special Characters Flash To XML

Jun 20, 2011

By sending the below text block from Flash there are problems with the through PHP created XML output.

[Code]...

I think some of the characters causing the problem. How to fix this problem?

View 1 Replies

ActionScript 3.0 :: XML And Special Characters?

Sep 18, 2009

I've got an XML-RPC server-client setup with Flash as the front-end and Delphi as the back-end. I'm essentially sending Strings which contain XML to Flash from Delphi. It's working without any real issues but one: Sometimes the Delphi side needs to send a ">" or "<" character in a string (e.g. "dn < ds").

This causes a problem when I try to convert the string to XML because Flash interprets that as malformed (the ">" or "<" could signify a tag). Will I have to comb the string for any occurrences and then escape them (as in "%gt;" for ">" and "%lt;" for "<") myself, or is there possibly some built-in method of dealing with those?

View 1 Replies

ActionScript 2.0 :: Load An Special XML

May 29, 2011

I have a flash (as2) movie that loads certain configuration data from a xml file, I would like the xml file was "not clear" to the user, which was zipped or encrypted in some way so that the user could not edit directly with notepad for example, but could be read as an xml in flash to get the data.

View 0 Replies







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