ActionScript 2.0 :: Use Switch Method With HitTest?
Jun 12, 2009
how do I use switch method with hitTest?
In this case I want to use the hitTest with the same intent of the _droptarget:
Code:
on (release) {
switch (_root.object6.hitTest) {
case _root.jogo.labirinto.fenda_MC :
[Code]....
how I use swtich with hitTest or the correct way to tell the program the path to drop the object in its target.
View 1 Replies
Similar Posts:
Aug 17, 2005
prepare the area with instances of the 3-people-MC for the "maximum amount of people" case (covering the whole area).have a shape in their midst, filled with a transparent fill (or have it be invisible, if that would still work with a hittest).resize the shape mentioned in "2." according to how many people I really want displayed (change width and height).have a function nested in each 3-people-MC that checks whether or not that MC is hit by the shape from "2.".make the 3-people-MC visible or invisible according to "4.".Is that doable? how would you write that? Before, I was just working with a mask- but I am having trouble checking if the mask hits the people MCs or not
View 6 Replies
May 26, 2010
I have a function videoList which I want to sort through my video URL's in my XML, using a switch/case method. The for loop in each case is bringing back all videos in the XML. How can I get just the videos for a particular case? Example: Introduction has one video, Our Work has none and Our Services has 5.
[Code]...
View 4 Replies
Aug 20, 2010
So I'm doing this project for school and all, and I'm trying to do a htitest on an object. For some reason, it doesn't work. So I tried writing out my own method... Which halff worked, but wasn't as exact as it should've been.
Heres my code (Though I'm pretty sure somethings wrong with my MC, so i'll upload the main .fla file)
Code:
right = true;
left = false;
itemX;
itemY;
[Code].....
View 1 Replies
Jan 15, 2009
i just would like to know how to create an "hitTest" script inside a movieclip that is actually part of that hitTest code?I mean... I have mc A, and mc B. and the current hitTest code im using (that is on the timeline) makes mc A, destroy mc B when collide with it... but there are many mc B on the stage (with the same instance name) so, when mc A collide with one mc B, it destroys ALL mc's B... but i want it to destroy only the mc B that he collides, not all the others... maybe an hitTest script inside a movieclip B would work (somethig like "if MC A hitTest ME = i die" (not all the others)).
View 1 Replies
Oct 30, 2011
What I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:
[Code]...
View 1 Replies
Dec 10, 2003
I want this on an MC:
[AS]
i = 0;
switch(thing){
case 0:
[code]....
Basically what I'm wondering is, will I lose the value of i in the first switch once I'm out of the switch? Can the second switch read the 1st switch?
View 8 Replies
Oct 29, 2011
Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.
[Code]...
View 1 Replies
Feb 8, 2010
i am controlling a tractor mc with right and left keyboard keys and let the user move the tractor till it reach a certain point where it touch a mc i want to go to a certain frame and stop the keyboard event listener and also the hit test listenerso finally the tractor is moved by user till it touches the mc then we will jump to a certain framethis certain frame will not have both of the tractor and the mcPHP Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.MovieClip;
[code].....
View 1 Replies
Nov 19, 2010
I am getting this error: 1180: Call to a possibly undefined method startWorld.but the method startWorld is defined as you can see in attachment.
View 4 Replies
Feb 19, 2010
I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.
Code: Select allpackage
{
import flash.display.MovieClip;[code]....
View 2 Replies
Dec 23, 2010
i have a fortran method which creates random numbers. i want to convert this method to a flash method . I want to get numbers from this method and use them in the delay method of flash.
the fortran method is the folowing
real znew1 , zold1 ,a,m,z1,p,TIME1
a= 16807.
m=2147483647
B=2
[Code]....
View 7 Replies
Feb 1, 2011
I have a class called Animal that has a method foo() and I call it out within the Animal class.
Code:
protected function foo():void
{
trace("Animal");
}
I also have a class called Cat that extends Animal and overrides the method foo()
Code:
override protected function foo():void
{
trace("Cat");
}
However when calling the function foo() from the superclass it traces out Animal not Cat (using a Cat object).How can I make superclass call out methods in the subclass?
View 14 Replies
Sep 14, 2010
two classes, both extend EventDispatcher. Static method in 1st class calls instance method in 2nd event not getting caught. [code]also, since dispatchEvent() is an instance method, is there any way of calling it without first instantiating the class? i expect not.
View 2 Replies
May 24, 2011
[Code].....
getUser was already in UserService.java. I just created getUser2 and it's identical to getUser. When I try to call getUser2, i get the "Cannot invoke method" error. question: Do I need to specify getUser2 in some other file? like in some configuration file? if so, which one and how do I do it.
View 1 Replies
Mar 6, 2010
Is there a way to get a method's parameters from outside the method? I know that there's an "arguments" property but it's only accessable from within the method. I'm working on a RPC system and need to store the method parameter types in a hash table for easy access later on.
View 1 Replies
Jul 24, 2006
Code:
class A{
function A(){
trace("construct");
}
private function moo(){
[code]....
yet this doesn't, I'd expect it to: construct, start mooing, moo!, moo!, moo!, ...yet the moo! moo! moo! doesn't appear, as if moo() never gets called it all.
View 1 Replies
Dec 19, 2009
how I can switch between different songs?The idea is that an animation will loop continuously (graphic, not a movieclip), and there is one button that will allow the user to change the background music.
View 1 Replies
Sep 14, 2007
I'm currently building a Flash Game for my work. I made a switch to check if my items fell into the right bucket. But when I was developing all my other functions I realized that I could handle this in an If Else instead...So the question is: What is faster (less CPU intensive), a switch or If Else?Here is my switch:
Code:
function getPoints(naam,orgNaam,baksoort):Void {
switch(baksoort){
case "bak_B01":[code]....
View 3 Replies
Aug 11, 2011
OK, from what I know actionscript in Flex runs asynchronously. I need the ability to run a method in a loop synchronously. Consider this code:
public class CustomerContainer extends VBox
{
public function CustomerContainer ()
{
[Code]....
This is not my exact situation as it is a bit more complicated to explain here. There is an abstract class and several custom view objects derived from it. Some of the views are dependent on others being completed first but I cannot seem to order them in the correct order. TIMERS are not an option. Probably not explaining this correctly.
View 2 Replies
Mar 2, 2012
I followed a tutorial about how to create a simple website. The buttons i've created SHOULD fade out the current page and fade in the new page. In it's current state it fades out the m1 instance (mainmenu_mc) but won't fade in the new page selected(p1,p2,p3orp4). After it's faded out if i click in the same area the button was the mainmenu_mc page flashes onto the screen. and when i let go of clicking it, dissapears again.
Code:
var m1:mainmenu_mc =new mainmenu_mc;
var p1:page1 =new page1;
var p2:page2 =new page2;[code]......
View 1 Replies
Jul 25, 2009
I am trying to create a weekly calendar. I have a 'switch' statement that shows the week dates and the name of month the week relates too. I have three functions
1. takes the pc date and converts it into the day of the year. eg between 1 and 365
2. it takes the day from 1. and assoicates it to the week number eg 1 - 52
3. functions that are associated with a previous and next button that use the current week number based on the pc date and count up and down.
This is where I have come unstuck. This is the code for my 'next' button.
Code:
function onClickNext(event:MouseEvent)
{
if(currentWkNum != 53)
[Code].....
View 5 Replies
Dec 21, 2009
I am a pretty good programmer in as3 - but I don't know OOP. -- and I am not so good that I don't have a ton learn -- when I look at all the differnt script commands I know my knowledge is tiny. I am now at the point where I could look at a website and make a pretty good attempt at coppying it and most my programming is dynamic driven. So I was wondering by making the leap to OOP would I have relearn a lot of what I know -- and what are the advantages
View 3 Replies
Dec 26, 2009
I've got a variable called coins which contains the amount of coins you have.I've also got a movieclip called customer_marker_mc which I want to change color depending how much coins you've got...I want 100 (or more) - 91 to give one color and 90 - 81 another and so on.[code]...
View 6 Replies
Mar 15, 2011
how I could create a switch in Flash. I have the movieclip, but I don't really know how to program it. I want it to work something like: if hitTest with "char" (our character) and the user is pressing space then gotoandstop(2);. Obviously, that's just the basic idea of how the switch would work EDIT: Here's my current code:
[Code]...
View 0 Replies
Mar 2, 2012
I followed a tutorial about how to create a simple website..The buttons i've created SHOULD fade out the current page and fade in the new page. In it's current state it fades out the m1 instance (mainmenu_mc) but won't fade in the new page selected(p1,p2,p3orp4). After it's faded out if i click in the same area the button was the mainmenu_mc page flashes onto the screen. and when i let go of clicking it, dissapears again.
Code:
var m1:mainmenu_mc =new mainmenu_mc;
var p1:page1 =new page1;
var p2:page2 =new page2;[code]......
View 1 Replies
Jun 6, 2009
I installed the new Flash Builder.Does anybody know how to switch the language to english?Looks like the installer installs eclipse in the langauge of the os.in my case that was german.I know you can change the language for FlashBuilder in Windows by editing one of the dll's. How to get the same result on MacOs?
View 1 Replies
Feb 13, 2005
is there any switch statement in actionscript? if there is, how does it look like?
View 3 Replies
Mar 27, 2009
I have a job where the client wants to switch an animation (movieclip) on the stage between the times of 10 a.m. and 12p.m. EST then the off time will just revert back to the original animation.
View 4 Replies
Jun 26, 2009
I need to include a swf file on my client's web page. The swf file includes 4 movie clips appearing one by one. Each clip links to their designated page. I want to have small buttons to let viewers to click and switch to the clip they want. When click, the still shot (may be the last frame) of the clip appears. [URL]
View 4 Replies