ActionScript 3.0 :: Match Two Arguments In One?

Jun 14, 2011

I have this piece of script, where I want to do a hittest when both the x AND y are not the same (and some other variables) now, that wouldnt be so hard, you think: if (MovieclipA.x!=MovieclipB.x && MovieClipA.y!=MovieclipB.y) but! if i now have a MovieclipC, which is on the same y coordinate as A, but not on the same x coordinate, the hittest wont execute..., as the y coordinates match...
 
it probably is really simple, but how can i solve this problem?

View 8 Replies


Similar Posts:


Actionscript :: Match Arguments/parameters When Making Override Function?

Apr 20, 2011

if I want to add something to the implementation of

public static function createPopUp(parent:DisplayObject,
className:Class,
modal:Boolean = false,

[Code]....

do I have to put all the arguments in my function declaration or does it pick them up implicitly?

View 1 Replies

Flex - Passing Optional Arguments (rest) Through To Another Method That Takes Optional Arguments?

Feb 3, 2010

I have a "format" method that works in a similar manner to the C# String.Format method, with the following signature:

[Code]...

View 3 Replies

Actionscript :: How To Get Value From Match

Dec 6, 2009

How to get value from match in ActionScript?

View 1 Replies

ActionScript 3.0 :: Search Through XML To Match ID?

Jul 9, 2009

I'm pulling news information from an XML file. The root node is "article", the child nodes are (for example) "date", "title", "caption", "copy", "link", etc.

Each time an article is added, a couple button (mc's) will be added to the stage. One button when clicked displays a movie clip and attempts to update the dynamic textfields within to display just the date and caption. The other button when clicked displays a different movie clip and attempts to update the dynamic textfields within to display all of the information noted above.

Being that this is dynamic and coming from an XML file, I want to avoid having to write if ... else statements for every new article (and each button).

Is it possible to search an XML document and scan for a name/ID match to create certain actions?

In other words, If I were to give an MC a name of "thisButton123" and also give an XML article node an ID attribute of "thisButton123", I could say something like if the currentTarget.name == any of these XML node attributes than pull that nodes content. Eliminating the need to compare/contrast names and ID's specifically.

View 4 Replies

Swf Doesn't Match My Fla File

Jul 26, 2009

I have a problem in that I've made a web banner - text with motion and shape tweens. Trouble is when I test movie, it not only plays in a different font to the one I've used in the design (metaPlus normal) it misses out text!?I'm not getting an exact replication of what the fla file is.[code]

View 5 Replies

ActionScript 3.0 :: Use Reg Exp To Match Every Line?

Oct 11, 2011

I'm counting lines of codes in my flash builder project, and I try to use Search function Ctrl+H, and search how many lines in *.as file, and I failed to match with /[.]+/, how can this be done?

View 6 Replies

ActionScript 2.0 :: How To Match Variable A To B

Jun 23, 2010

I want to make a mail script. The user will enter the recipient's name, which is linked to variable "name". I've got a variable, EMAILA which is
ActionScript Code:
var EMAILA {
Cem : "cemgokmen97@gmail.com",
Muhittin : "gokmen@itu.edu.tr"
}

And on the SEND button, I have this code :
ActionScript Code:
on(release){
if(name){
getURL('mailto:'EMAILA[name]
}}

But for some reason when the mail client opens, the address does not appear in the "To" box.

View 6 Replies

ActionScript 3.0 :: XMLList Empty When Only One Match?

Sep 7, 2010

I have a problem with XML filtering. [code]If there is only one result, trace is empty. If there are 2 results or more, they will be traced fine. Is it because one result is not an XML 'list'? If so, how do I get the results if there is only one match?

View 2 Replies

Scale Swf To Match Browser Size?

Jul 17, 2010

I've created a website in Flash and have posted it to the net. I want it to scale as the user resizes the window, but having little formal training in Flash I'm not entirely sure how to go about it.

View 4 Replies

Regex :: Match Something With RegExp Between Roundbrackets?

Jun 25, 2009

I have this:

var regExp:RegExp = new RegExp("((.*?)%)");

and want everything between the ( and the %)the string looks like this: (-24%)I now get a return back "(-24" and have searched for a long time to find a solution but didn't find any.

View 2 Replies

Actionscript 3 :: Check An Array For A Match

Jan 12, 2010

If you have an array with six numbers, say: public var check:Array = new Array[10,12,5,11,9,4]; or public var check:Array = new Array[10,10,5,11,9,4]; How do you check for a match (of a pair?)

View 2 Replies

Actionscript 3 :: Comparing Two Bitmaps Against Each Other For Match?

Mar 25, 2011

I'm trying to position an image on top of another image based upon the make-up of the smaller image. The smaller image is a cut-out of a larger image and I need it to be positioned exactly on the larger image to make it look like a single image, but allow for separate filters and alphas to be applied. As the images are not simple rectangles or circles, but complex satellite images, I cannot simply redraw them in code. I have quite a few images and therefore do not feel like manually finding the position of each image every and hard setting them manually in actionscript. Is there any way for me to sample a small 5-10 sq. pixel area against the larger image and set the x and y values of the smaller image if a perfect match is found? All the images are in an array and iterating through them has already been set, I just need a way to sample and match pixels. My first guess was to loop the images pixel by pixel right and down, covering the whole bitmap and moving to the next child in the array once a match was found, leaving the matched child where it was when the perfect match was found.

View 4 Replies

Actionscript :: Matching Traces Don't Actually Match

Sep 28, 2011

i'm itterating thru an array of text field objects and tracing the selected focus field when pressing tab, as well as each object.i'm trying to equate these object, but while they trace the exact same they are not.

m_InputFieldsArray = new Array(m_TitleTextInput, m_CommentsTextArea, m_EmailTextInput);
for (var i:Number = 0; i < m_InputFieldsArray.length; i++)
{
trace("Get Focus: " + Selection.getFocus());

[code]....

the first group traces the same, but apparently they do not match. Selection.getFocus() returns a string, while the array index is tracing the text field object. if i add toString() to the text field object it will trace as [Object object] how can i accomplish a match?

View 2 Replies

ActionScript 3.0 :: .match - How To Find First Index

Aug 9, 2011

I am stuck with a string search

ActionScript Code:
var str:String = "this is better than what is better.";
var pattern:RegExp = /this.*better/gi;
var results:Array = str.match(pattern);

I want to search in a string from word1 to word2 and place all the results in an Array. So this should be accomplished using match().However the above code would return " this is better than what is better" while it should return "this is better". So the output takes the last match in the line, but I want it only to output till the first match in the line.

View 4 Replies

ActionScript 3.0 :: How To Match Substrings Accurately

Mar 14, 2010

How to match substrings accurately?eg: I wanted to search whether any pronouns like he, she etc are present in a string say input.Where is he?Here I wanted to find whether the pronoun 'he' is present. But since the where contains the substring 'he' I can't get the result properly.I tried with RegExp and arrays and strings; using match(), search() indexOf(). They all do it the same way.My RegExp pattern is as below:

Code:
var pronouns:RegExp = /(i)|(me)|(us)|(he)|(him)|(she)|(her)|(it)|(they)|(them)|(that)/;

I wanted to find for eg, strings like

He is alright
Where is he
She is there
Who is it
I know them

In the above sentences I wanted to get the position of where the pronouns 'he' 'she' 'it' 'them' etc occurs.Why because if it occurs I wanted it to replace them with another words.

View 3 Replies

ActionScript 2.0 :: CS3 Match XML Attribute Name To Text Box Instance Name?

Jun 26, 2009

I have a list of items in XML that populate dynamic text boxes using the code below. I basically reference an attribute in the XML element to a specific instance name on a text box.

This works great for a few items, but I need to do this for several hundred, perhaps a thousand, items in an XML. Rather than copy & paste my code for each item and call out each specific text box and attribute value, is it possible to modify this code to match an instance name to the XML attribute value? In other words, one set of code that says "if the text box instance name is "x," provide the price of "x" from XML, but if the name is "y," provide the price of "y."

My xml code (3 item sample):

PHP Code:

<products>
<info_source id="SQL">
<item id="apples">$1.00</item>
<item id="oranges">$2.00</item>

[Code].....

View 4 Replies

ActionScript 3.0 :: How To Match / Track Object In Video

Jul 19, 2009

I've got a video with a black rectangle that moves, tilts and zooms...is there any way flash can match an object to that? (for example, if I want to put an image over the black box?? Is there any way to detect where objects are in a video from flash? I've seen some things with web cams where snow collects on people in the cam, etc. so there's got to be some way to "find" things.

View 3 Replies

Match Up Shape So It Vibrates To Sound On Rollover

Mar 1, 2011

I'm trying to match up a shape so it vibrates to the sound on rollover.On rollout I'd like it to slowly deminish the vibration as the sound deminishes too.I've experimented with a number of functions with out success.I've included the source code i've been working on, Should the source file be required I will supply it on request.[code]

View 4 Replies

X And Y Coordinates Do Not Match For Dynamically Generated Movieclip

Aug 6, 2011

I have a movieclip that I am adding to the stage dynamically. The movieclip has to be placed at specific coordinates to match the current text field.The coordinates that show on the INFO tab are x=264 and y= 365. However, in order to get the movieClip to match those I have to set x to 398 and y to 200.If I set the coordinates to those in the INFO tab then the movieclip does not show; it appears off stage.

View 2 Replies

ActionScript 3.0 :: The Package Does Not Match The File Path

Apr 20, 2010

The package does not match the file path

View 4 Replies

ActionScript 1/2 :: SlotMachine / Match Game Scoring

Sep 24, 2010

I am working on a game that is set up like a slot machine. The first box contains a name, the second box cotains a piece of information about the person and the third box contains another piece of info. Each box has a movie clip in it that contains 10 frames, each frame has text in it (a name or piece of information). There are up and down arrows above the second and third box as the user can control what piece of info is in that box using the arrows (if the user clicks the up arrow they go up 1 fram to different info....if down down a frame to new info.) The first box is not user controled, it has a button that randomly generates the name the player is given with a spin animation.
 
The goal of the game is to match all three boxes the random name with the 2 user controlled pieces of info. If this happens I want the player to receive 20 points. However, if the player only matches one of the pieces of info to the random name then they should only get 10 points. If they do not match ny pieces then no points are awarded.

I figured the best way to do this would be to give the corresponding correct answers and names matching variable names and set it so if you have 2 matching variables you get 10 points and if you have 3 matching variables you get 20 points (no points awarded for 1 variable because 1 variable alone would be the name). My problem is that I dont know how to assign a frame a variable number and I also dont know if its even possible to do something like this. Am I on the right track or is there a much better way to set up scoring?

View 1 Replies

Professional :: Text On The Stage Not Match The Movie?

Jan 16, 2011

I have a paragraph of text on the stage that looks good (Helvetica Neue, Ultralight), but when I play the movie it looks much thinner and really bad. Why does the text on the stage not match the movie?

View 1 Replies

ActionScript 3.0 :: Memory Game - Match Two Different Colours?

Nov 21, 2011

This person created this game:http:[url]....i was wondering if i wanted to match two different colours, how could i do this? for example, instead of matching two reds, if i wanted to match a red and green, how is this done?

View 2 Replies

ActionScript 3.0 :: How To Calculate Font Size To Get 2 To Match

Nov 22, 2011

Does anyone know why the font size in flash is smaller than in Microsoft .NET GDI+.Does anyone know how much smaller?Does anyone know how to calculate the font size to get the 2 to match?

View 2 Replies

ActionScript 3.0 :: Get An Array Of Indices Along With String.match()?

Sep 1, 2009

Code:
var s:String = '%include %unquote(&open.gtestit&close);';
var re:RegExp = /([%&]?w+)/g;
var a:Array = s.match(re);
trace(a.join('
'));

I'm splitting the string up into words (w) where the word might have an optional % or & in front of it. The output is what I expect:

Code:
%include
%unquote
&open
gtestit
&close

Is there a way to get the index of each matched string in one call? I know I can walk the original string using the resulting array and get indexes, but was hoping there was something similar to MATCH(). Something like:

Code:
var array:Array = s.index_match(re);

and the results would be:

Code:
array[0] = 0
array[1] = 9
array[2] = 18
array[3] = 24
array[4] = 31

View 2 Replies

ActionScript 2.0 :: Preloader Text And Image Don't Match

Mar 25, 2010

the preloader bar doesn't reach its maximum size while the text goes from 0% to 100% correctly (when it says 100% the bar is still at 20 or 30 percent of its original size).[URL]This is my website, with the preloader at the beginning: [URL]

View 8 Replies

ActionScript 3.0 :: Get A Regex Match On HTML Code

Mar 7, 2011

I am trying to get a regex match on HTML code that is parsed into a text box in flash. I have successfully loaded the HTML code and then began the regex matching, but am stuck on getting the right regex expression to match. The code that I am using in html page builds a tree view list on the html page, so once it's loaded into the flash text box, i am trying to match the html pages to build a list from. The code below is what I am trying to match.

The code I want to match is the first two items in quotes for each entry to build the array list of page names, and their URL. The problem is that the pages won't be named as nice as the example below. Each time it can be a different page name, and page url, so I need to match what is in the first two quotes.

[Code]...

View 5 Replies

ActionScript 2.0 :: Use An Array To Match Up With A Variable From An .asp Page?

Jul 14, 2004

i'm trying to use an array to match up with a variable from an .asp page.. that is, i want to load a particular .swf file based on that returned variable.I'm not sure that loadMovie even supports this kind of tomfoolery... anybody out there who be's smarter than me know?

Code:
var swfs2Load=new Array("sin.swf","flirt.swf","entertainment.swf","dizzyfunk.swf","aura.swf","privilege.swf","envy.swf");
function dayTest(){
_root.maincontent_mc.loadMovie(swfs2Load[getData.day])
}
getData = new LoadVars();
getData.load("whatday.asp", getData, "GET");

View 2 Replies

ActionScript 2.0 :: MovieClip Nested Within Another To Match Coordinates

Nov 17, 2006

I am trying to get a movie clip - nested inside another movie clip on the stage - to match the x, y coordinates of the mouse. Attached is an example file both in Flash 8 and MX2004 formats. I can get the drag to occur, but the problem is that the dragged mc's coordinates are relative to it's parent movie clip and not the stage. I have been messing around with localToGlobal with not much luck. I think I may be using it wrong, though. I have left it out of the example file.

Here is the relevant code:
var dragging = false;
this.onMouseMove = function() {
if (dragging == true) {
this.container.drag._x = _xmouse;
this.container.drag._y = _ymouse;
}};
[Code] .....

View 3 Replies







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