ActionScript 2.0 :: Create Something Similar To The Str_replace Function?
Sep 28, 2005
i am looking to create something similar to the str_replace function (from PHP) that will replace all occurrences of the search string the replacement string from within an larger string. Does anyone have something like that created already (save me the time)?
ie
var myStr:String = new String( "i wish i were an oscar meyer weiner" );
var myOutput = str_replace(myStr, "i", "we");
// myOutput would now = "we wish we were an oscar meyer weiner"
I have a solid programming base (C, C++ and C#). I was looking for some Flash samples over the Internet and I found a Flash Carousel but my doubt doesn't regard it but something simpler than that.
Consider the following sample: http[url]...., when the user clicks on any of the buttons of this carousel a screen is opened with the corresponding image on it but the user still can see the background because the opened screen has an alpha (close button and a legend). I'd like to know how that is done, I've seen this kind of behavior in many galleries and stuff on the Internet but I don't know how that is called and how to create a similar screen.
Im trying to create a banner similar to the one seen on this website:[URL].. It has numbers to take you through the images, previous/next tabs and it autoplays with a pause button also. All the pictures link to various places around the site, and i cannot find anywhere on how to go about creaating something like this.
Ive been reading and watching tutorials all over and can do the basic tweening and autoplay/loop funtions with timer and timer reset in it, but i dontknow how to go about this one as im very new to this.
I'm trying to create a number of similar variables using a for loop, rather than having to explicitly write out each variable. For instance, I need 9 variables called zone1, zone2, zone3 etc. So rather than writing it out like so...ActionScript Code:public var zone0:Zone = new Zone(); public var zone1:Zone = new Zone(); public var zone2:Zone = new Zone();// etc. etc. After a look around on the internet, I came up with this, however, it doesn't work...ActionScript Code:for (var i:uint = 0; i<=8; i++)public var this["zone" + i]:Zone = new Zone
I'm trying to create a number of similar variables using a for loop, rather than having to explicitly write out each variable.For instance, I need 9 variables called zone1, zone2, zone3 etc.[code] After a look around on the internet, I came up with this, however, it doesn't work..[code]
I want to create a editor in Flash that looks similar to this. I need the line numbers on the left side and the text on the right.Is this something that is possible in flash? Can someone give me some ideas to start with. I am a beginner to flash but I catch on quickly.
I have a project which uses very similar code for I think 12 or 13 different movieclips. I actually copy-pasted a good chunk of the code changing words and numbers here and there.[code]The main point of this part of the project is that each movieclip is a selector on a scrollbar. I just wanted the selectors to look nice, so they tween up and down on rollover and when they are clicked they change from black and white to color. Also when clicked they move a very long movie clip called customizing_forms_mc, into view on the stage. The code is inside a movieclip that contains all the selectors. There is a layer for each selector and on that layer is the code for that selector. I was thinking that there might be a way to call a fuction perhaps with the variables that are brought to the function being strings that i could substitute in for the names of the movieclips. I tried attatching the fla or an swf but they are both too large. For a more detailed look at the code on the stage:[code]As I previously said there is a scroller with the selector buttons and when clicked they bring a certain part of another movieclip into view. Of course, everything is masked so it looks nice.
Is there any other function similar to 'hitTestObject'. Am having problem with this function, b'coz it checks the collision on a box around that object. I want to find the actual collision with the object.
I am trying to create a flash intro webpage similar to this: [URL]..I have got a AS2 code that allows me to scale the video as seen here.... www.the10thletter.info/ebh/intro (seen code below)
I also have a AS3 script that positions the logo in the middle of the page (seen code below)
I want to create a game similar to all the reaction time games out there, with the difference that my game has a set amount of time that you as the player will have to guess when it occurs (with a simple click). Each player has a number of tries where the closest time from the set time wins.
I have been asked to create a wheel for navigation similar to on the Visit Provence website. However, I don't know where to start and my Googling effort have been unsuccessful - I guess that I am searching using the wrong terms.It the the way that the wheel moves and interacts with the other segments around it that interests me.
i'm trying to create a game that has a similar concept as Dance Dance Revolution - if shown is a down arrow then press down, if up arrow is shown then press up ...i'm having problems with the "if shown is a ... arrow" part - i managed to get pressed key check working, so if you press the correct key you'll progress but if you press the wrong one the appropriate action will execute.
in frame 1 i have the movieclip that contains the arrow display with the following code:
onClipEvent(keyDown){ if (_global.x = "up") { if (Key.isDown(Key.UP)){ gotoAndStop("down");
[code]....
looks ok to me, but when i tested by changing the if condition for the mc action to if (_global.x = "down") the thing still executed as if _global.x = "up" .
I'm trying to create a "floating" style navigation similar to the link below but WITHOUT and 3D effect. Just text/navigation that is floating and reacting ever so slightly to the xmouse/ymouse and maybe scaling on rollover or something...I don't know where to start...
anyone have a tutorial or link that has something similar in effect?[URL]..and also the "solutions" section of this site, although this doesn't really interact with xmouse/ymouse[URL]..
and here is another that uses imagery and full screen...[URL]..
how would I go about creating a custom progress bar like the one Grooveshark used to have? If you look at the image below, the progress bar is an image in the shape of a shark and fills in as the page loads.
I think this is very cool and would love to know how it is done. Can this be done programmatically, or is it done in flash? I would really like to do this in JavaScript (jQuery) if it is possible. Where/How do I start?
I am creating a card game everything is fine but I am not able to create a stack of cards as follows: If I have 4 cards that are represented in an array such as 4,5,6,7 of Spades then I want the card with the least priority to be placed on top and the highest priority card placed behind the first one.
I was hoping someone could help me working out some advanced data reformatting. What I'm hoping for is a function where I can input a value along with an array of key positions like so:
function remap(percentage:Number, keypoints:Array) { ...
The array would start with the minimum and end with the maximum point, with nested key points along the way. For example, I would input something like remap(0.25, [0:0,80:50,100:100] ) and the function would 'imagine' a spline curve graph from (0,0)-(100,100) with a key point of (80,50), then return the y value that is 25% along that graph.
I understand that you make an event listener and an event handler, but I do not understand how to create a function were I can hold down a key and the object keeps moving until the key is up.With the following function it only moves it every time I press a certain key. I need to move while the key is held down until released.
stage.addEventListener(KeyboardEvent.KEY_DOWN, jumpEvent); private function jumpEvent(event:KeyboardEvent):void { if(event.keyCode == 17)
I want to create a function that can create new MCs. I have a movieClip exporting as "Box" in my library, and I want to add an instance to the stage called "box"... like so:
Code: function addNewMC (instanceName:String, mcName:MovieClip) { instanceName:mcName = new mcName; addChild(instanceName); } addNewMC(box, Box);
but that does not work! I think it's something small, but I'm not sure what. I'm going to use this function for a bunch of different MCs, which is why I want it to by dynamic.
Is it possible to create variables with a function? I don't mean create my own variable in a function but actually have the function create a unique variable name (eg. exam1, exam2 and so on) they would all have the same data type.
How would one go about creating a function inside a for loop that does not have a button action attached to it while still having access to the current index number.
This code was found on senocular:
Code: var curr_button; for (var i=1; i<=3; i++){ curr_button = this["button"+i]; curr_button.num = i;
[Code]....
This is all great however i would like the functions to just be regular old functions, not button actions (onPress), is this possible?