Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Search And Destroy



I have a box with 5 pieces of paper inside
myArray1 = new Array ("1","2", "3", "4", "5");

I am going to chose a piece at random from the box

$i = random(5);
trace(myArray1[$i]);

That piece has now been removed from the box, therefor it has to be removed from the array, now I can't find any tutorials on how to remove from mid-array only begining and end, so I thought of this,


ActionScript Code:
for (var $loop = 0; $loop < myArray1.length(); $loop++)   {   if ($loop <> $i)      {      myArray2 = new Array();      myArray2.push(myArray1[$loop]);      }   }trace(myArray2);


Now maybe I am wrong in how I have set this up, but im thjinking if the loop index of the random piece is equal to the random number, then skip that, else, put all the other pieces in a new box.
but when i trace the 2nd array, it displays the random value.

I don't know what I am doing wrong. Is there any way to move everything from an array into a new array WITHOUT a certain element? I mean I know you can move a certain element via its array possition, any form of array.pushNOT($n, ($n+1))



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 01-18-2004, 11:36 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Search And Destroy
how can i refer to any of a selected set of MC's in order to duplicate movie?

naming convention is striker_1, striker_2 etc etc, but any mc's can be present or not at any time

i think this has somehting to do with arrays, but i'm not sure how to use arrays!!

Search And Destroy
I have a box with 5 pieces of paper inside
myArray1 = new Array ("1","2", "3", "4", "5");

I am going to chose a piece at random from the box

$i = random(5);
trace(myArray1[$i]);

That piece has now been removed from the box, therefor it has to be removed from the array, now I can't find any tutorials on how to remove from mid-array only begining and end, so I thought of this,


ActionScript Code:
for (var $loop = 0; $loop < myArray1.length(); $loop++)   {   if ($loop <> $i)      {      myArray2 = new Array();      myArray2.push(myArray1[$loop]);      }   }trace(myArray2);


Now maybe I am wrong in how I have set this up, but im thjinking if the loop index of the random piece is equal to the random number, then skip that, else, put all the other pieces in a new box.
but when i trace the 2nd array, it displays the random value.

I don't know what I am doing wrong. Is there any way to move everything from an array into a new array WITHOUT a certain element? I mean I know you can move a certain element via its array possition, any form of array.pushNOT($n, ($n+1))

Search And Destroy
Hi,
I'm trying to manage a flash page with wordpress cms by reading the feeds but I'm stuck with the images part.

this is the data that I'm reading in flash
Code:

<p>someText... someText... someText... someText... </p>
<div class="mceTemp">
<dl id="attachment_3" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://localhost/wordpress/wp-content/uploads/2008/07/dscn2222.jpg"><img class="size-medium wp-image-3" title="myTitle" src="http://localhost/wordpress/wp-content/uploads/2008/07/dscn2222-300x225.jpg" alt="myCaption" width="300" height="225" /></a></dt>
</dl>
</div>


I don't want to display the image below the text, I want to store the image link, title and caption into vars to able to display the image in whatever way I want - for example to in the background of current flash section/page.

So how can I erase all the div class and only retrieve this data?
Code:

var imageLink:String = "http://localhost/wordpress/wp-content/uploads/2008/07/dscn2222.jpg"
var title:String = "myTitle"
var thumbLink:String = "http://localhost/wordpress/wp-content/uploads/2008/07/dscn2222-300x225.jpg"
var caption:String = "myCaption"

any help or suggested path greatly appreciated,
Thank you.

Destroy() ?
hi
Does anyone have any pointers on how to use
destroy()

I've figured out the youtube API tips at
http://code.google.com/apis/youtube/...reference.html

And i have a test site working at
http://www.smolenski.com/bas/

But i can't get multiple netstreams to swap out and play different youtube videos. They just continue to play the audio of the video I'm trying to swap.

Cheers
Bobsmo

CreateTextField And Destroy
Hi,

I create a text field with the method createTextField.
How can I destroy this text field

Thanks
David

Can't Destroy The Enemies
i creating a game but i cant get the enemies to die when the missile hits them. if you want a look at my code email me at lvant1@eq.edu.au

How To Destroy A Child
hi ppl
i load an external swf,
i add it to a container on the screen
then i need to remove it

loadeR.load("some.swf");
container.addChild(loadeR);
container.removeChild(loadeR);

but the some.swf has a song playing.. and it wont stop after the child is removed

how do i destroy the loadeR thing??

How To Destroy A Loaded Swf
i loaded a swf called vid.swf into an mc called dock, now, is it possible to destroy the vid.swf that's loaded into the dockMC to make it go away ?

How To Destroy A Loaded Swf
i loaded a swf called vid.swf into an mc called dock, now, is it possible to destroy the vid.swf that's loaded into the dockMC to make it go away ?

How Do I Destroy A Button On Click?
I wanne make a button that when I press on it it simply disapears, not becomes 100% Alpha, or moves, disapear, deleted, destroyed.
how do I do that?

How To Destroy/free Object?
hi,
i got an Object, for example LoadVars.
i created it:

Code:
var my_lv:LoadVars = nre LoadVars();
and now i want to destroy it, free it from the memory?
how can i do it?
is this the right way?

Code:
my_lv = null;
what do u say?

Avi.

Destroy/Delete A Movieclip?
Hey every1.
I have a question (I'm sure somebody asked it before, but I didn't find the threat...) :
How can I delete/destroy/whatever a movieclip during a movie? I made a game, in the game there is a zombie (movieclip), and when its life (life???) reaches zero, it should be destroyed. I tried "removeMovieClip(this)" and much more, but it didn't work, but also there were no errors.

Create/Destroy Object Help
I have a challenge that is driving me nuts. There should be a simple solution to this but I think the forest and the tress analogy is what I've got going on. I have a very simple setup - a Flash file is loading a text file with a number of variables and values. The Flash file creates a series of buttons and labels based on the info that is coming in from the text file. Once the items are on the screen, I want the user to be able to choose a button and the program SHOULD clear all the created objects off the stage so new objects can show up.

I have attached the code for the Flash file the first set is on the first frame and the second on the second frame. I know that everything works up to the destroyObject call. Objects show up on the stage, they are given the correct text and instance names and they even send info (like their instance name) to the listener. The stupid objects just won't go away!

Any suggestions? Thanks for the help!


//frame 1 AS
loadVariables("installer.txt", _root);
_global.style.setStyle("fontSize", 18);
//"loop" while loading variables from text file
function checkParamsLoaded() {
if (_root.completeVar="yes") {
clearInterval(param_interval);
gotoAndStop(2);
} else {
trace("loading");
}
}
//put "loop" in motion
var param_interval:Number = setInterval(checkParamsLoaded, 100);
//
stop();

//frame 2 AS
var yLoc:Number = 485;
for (var i:Number = 1; i<9; i++) {
if (this["lang"+String(i)] == undefined) {
i = 9;
} else {
yLoc = yLoc-40;
_root.createClassObject(mx.controls.Button, "lang"+i+"Inst", this.getNextHighestDepth(), {_x:500, _y:yLoc, _width:130, _height:30, label:this["lang"+String(i)]});
_root.createClassObject(mx.controls.Label, "inst"+i+"Inst", this.getNextHighestDepth(), {_x:350, _y:yLoc, autoSize:"right", text:this["inst"+String(i)]});
}
}
stop();
//functions and listeners for all buttons to be clicked
var listener:Object = new Object();
listener.click = function(button) {
//clear the stage
for (var i:Number = 1; i<9; i++) {
if (this["lang"+String(i)] == undefined) {
i = 9;
} else {
destroyObject("lang"+i+"Inst");
destroyObject("inst"+i+"Inst");
}
}
};
for (var i:Number = 1; i<9; i++) {
this["lang"+i+"Inst"].addEventListener("click", listener);
}

[F8] How To Close/destroy Loadmovie?
I have attached a .swf to load inside a MC. This is the AS inside the MC on a blank frame:
code: this.createEmptyMovieClip("mHolder", this.getNextHighestDepth(), 200, 500, 500, 500);
loadMovie("oranges.swf", mHolder);
mHolder._x = 50;
mHolder._y = -200;
stop ();

I have a button inside this MC so when you click on it the MC closes and returns to the start up screen. This is the AS on this button:
code: on(press){
gotoAndPlay(11);
_root.stateOpen=false;
}

Problem is when the MC closes the attached .swf stays on screen..
How can I get the attached .swf to close when the MC it is inside is closed??

Does Flash Destroy PHP Sessions?
I think I need to ask it more simply....my other post was confusing. Does Flash destroy PHP sessions right away? I'm having Flash and PHP Session issues...the session seems to be getting destroyed quickly after its made. Any ideas?

So There Is ABSOLUTELY No Way A Class Can Destroy Itself ?
A Class cannot removeChild() itself whatsoever ?

Just to be certain because if there is absolutely no way, I will give up on implementing this.

Thanks.

Can't Destroy Movie Clip
I have an object at the middle of the stage. When the mouse is overlapping it, the mouse pointer will be invisible, and be replaced by an animation of a move clip where the pointer is burned to crisp.

The problem: I need to destroy mcArrow (the burning curser animation) when it reach the last frame.

I Tried the following code at the last frame:

quote:ActionScript Code:
if (parent) {
parent.removeChild(this);
}

However, when the movie clip disappear, it gives the following error:



quote:TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MinArrow/frame1()

Note that the error is generated at the first frame. If I remove the code from the first frame, the error hits the second frame instead.

Its not even supposed to return to the first frame, since the movie clip should have been destroyed.

I hope this makes sense. The files can be downloaded here:
www.kasperhviid.dk/stuff/reklame.zipwww.kasperhviid.dk/stuff/reklame.zip

- Kasper

Can't Destroy Movie Clip
I have an object at the middle of the stage. When the mouse is overlapping it, the mouse pointer will be invisible, and be replaced by an animation of a move clip where the pointer is burned to crisp.

The problem: I need to destroy mcArrow (the burning curser animation) when it reach the last frame.

I tried the following code at the last frame:

quote:ActionScript Code:
if (parent) {
parent.removeChild(this);
}

However, when the movie clip disappear, it gives the following error:



quote:TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MinArrow/frame1()

Note that the error is generated at the first frame. If I remove the code from the first frame, the error hits the second frame instead.

It's not even supposed to return to the first frame, since the movie clip should have been destroyed.

I hope this makes sense. The files can be downloaded here:
www.kasperhviid.dk/stuff/reklame.zipwww.kasperhviid.dk/stuff/reklame.zip

- Kasper


EDIT: Sorry about the double post - I pressed enter when the curser was inside the title field. Stupid ...





























Edited: 05/29/2008 at 05:42:53 AM by Kasper Hviid

Time Travel Will Destroy US ALL
PHP Code:



function time() {    space();}function space() {    time();}//"I wouldn't if I was you!" var timeTravel:Function = space, time; 

Preloader Destroy My Site....
i load a file to a movieclip and everything seems to look good..but after i put a preloader to the file that i load to the movieclip,every tthing went wrong.the stop(); dosent work ,and a lots more.......
where should i put the preloader?

How To Destroy A Sound Object That Was Created?
hey guys..... have a little issue here, and will try to be easy to understand...

my problem: I create a sound object in frame 1, scene1 from a MC that contains BG music I want to play during an intro that spans scene 1,2,3. There's a MC onstage (that contains the BG loop) which is swapped to _level99 and named so that it spans all 3 scenes (also allowing me to create a sound object of it by targeting)

myLoop = new Sound( "mySoundClip");

There is also an onClipEvent() on this MC which watches for a var to fade the music in or out. This all works perfectly - not the issue.

At the end of scene3, I remove _level99, the named MC AND delete the sound object - after it fades out - therefore leaving no trace of it, or so I thought. In scenes 4, 5, 6 I am using addListener keys to watch for the user pressing the pgUp and pgDN keys. This also works fine EXCEPT that when jumping back in the timeline even just 5 or 10 frames in either scene 4, 5 or 6, (never going back to scene 1,2,3) the BG sound turns on again, at full volume.

What gives? I have tried everything, and cannot seem to get rid of this damn sound object. I've tried delete; I've tried unload; I've even tried redefining the sound object with the same name. Still nothing. Moving forward in the timeline is fine, but the minute I try and jump backwards in 4,5 or 6, the clip comes right back. I have debugged it, and it shows no occurrence of the sound object, or of the MC after scene3.

Hopefully one of you guys have experienced similar problems.

Thanks for taking a look.

Tile Based - Destroy Tiles
Hello, name's Matt, new to FlashKit.

I've been using flash for some time now, so I'm nothing short of cluey when it comes to making applications and such, although the game scene is never something iv'e tapped into.

Been following the wonderful tutorials by Sir.Tonypa, and Klas (OOS), and have a general understanding of how it's all working.
Im making a small Pac-man type of game, where as I can shoot, and blow holes through walls, as can the enemy.
Ive managed to get some cool AI working, and for them to shoot and attack me as I do the enemy. although my question is about how do I go about changing tile states to walkable/non-walkable once been shot... for a while I figured i could throw in a 'non-moving' enemy, that when i shoot, it dies and becomes a walkable area, although this didn't seem to work as planned.

I guess I'm just looking for some guidance, not so much as source and examples (keen to try this without ripping anyones code). So if anyone knows of links to similar posts with answers, or anything that may be of assistance, it would be mucho appreciated.

Mind you, I have been searching, for a few days now, and nothing has shown up with what I'm after.
Cheers guys, lookin forward to a favorable responce
--
Matt

[F8] Destroy All Instantiated Functions And Variables?
Is it possible to for example, jump to keyframe 14 where many functions and variables are instantiated, from keyframe 2, and then delete ALL variables, functions, and function events (like onEnterFrame) created on keyframe 14 and then jump back to keyframe 6, where more functions need to be instantiated, some with the same name as on keyframe 14 but doing different things?

Thanks.

Destroy A Previously Created MovieClip
I'm dynamicaly creating MovieClips with something like this:


Code:
var container;
container=this.attachMovie("Contenedor","contenedor_" + this.contenedores.length , this.getNextHighestDepth());
contenedores.push(container);
So later, according with some events i need to destroy those movieclips and get them out of the Array "contenedores". How can i do that?

Thanks in advance.

Generate/destroy Movie Clip
not sure how to fix this

if i could get a piece of code that generated a movieclip
instance of the button it might help.
thought that if how the buttons operate & become
accessible were changed it might fix the problem.

suggestions?

---

was working on an application and ran into a bit of aproblem
my buttons wouldn't work properly. first i thought it was just
an issue of badly defined hit areas/states

but i believe its because the buttons are overlaping each other
and blocking one another. so when the top buttons becomes
invisible and inactive they block the bottom butttons and end
up not functioning properly

Create / Destroy Textbox Function :: Not Working
i have a series of buttons over which i want a text box to appear when they are the rollOver and rollOut events are triggered.

on rollOver i want the box to be created and display content

and on rollOut i want the box to be deleted

the box is created fine and displays the content and follows the mouse just like it's supposed to ... but it won't go away when i say delete _root.label

any ideas how to fix this?

here's the code

PHP Code:



makelabel = function () {
    _root.createEmptyMovieClip('label', 1002);
    _root.label.createTextField("insidelabel", 1003, -30, -30, 50, 18);
    _root.label.insidelabel.background = true;
    _root.label.insidelabel.selectable = false;
    _root.label.onEnterFrame = function() {
        this._y = _root._ymouse;
        this._x = _root._xmouse;
        _root.label.insidelabel.text = _root.select;
    };
};
destroylabel = function () {
    delete _root.label;
}; 

_alpha Destroy Everything / OnLoad Doesnt Work
Ive got 2 problems:
1.
there are 10 mcs (point0 to point9) in first frame
in second frame there are the same points but in diffrent positions.

when i add action eg:
point1._alpha = 50
in first frame and click "electronic" button point1 doesent move....

2.
point1.onLoad = function(){
trace("ll");
}

onLoad doesent work ....

source: http://www.dagami.lodz.pl/mac/v3mac.fla

What Are The Codes Needed For A Class Instant To Completely Destroy Itself ?
An external class is loaded and it do its stuff.
It realize it is time to die internally, it have the functions to detect that.


now I head of those "if you delete it might still be in memory" crap.
What is the ultimate code to completely.....COMPLETELY destroy the instant from existent ?

Attatching A Movie Clip To Play 3 Times Through Then Destroy()?
How would i attatch a movie clip, call it to play three times through then remove it from the stage when a button is pressed? Would i have to use an interval or are there other methods?

Senocular XML Search Tutorial (search Query Case Sensitive)
Hi
I've just tried senocular's xml tutorials.

http://www.kirupa.com/web/xml/examples/searchbestof.htm

The search query seems case sensitive. How to make it accept upper and lower case characters. Actually i'm trying to make a search by myself by using the same code.

Senocular XML Search Tutorial (search Query Case Sensitive)
Hi
I've just tried senocular's xml tutorials.

http://www.kirupa.com/web/xml/examples/searchbestof.htm

The search query seems case sensitive. How to make it accept upper and lower case characters. Actually i'm trying to make a search by myself by using the same code.

Search Engine -user Can Search His Pictures With Keywords- HELP
I was reading about search engines and I came across a post. Being fairly new to flash I do not know how to develop this. I have a client who owns a small furniture store. I am setting up his site. He wants it to be all flash based. He has about 300 pictures of his products.I need to make a search engine in Flash so that the user can search his pictures with keywords. I read a suggestion that would fit my needs- create an array of picture names then use a loop to check if the keyword is in the array. I have been going through tutorials with no luck- can someone please help. Maybe start the code the person is talking about so I can just expand on that.

How To Build A Search Engine To Search Ur Own Flash Site?
Hey its Stuart here again.
How do you build a search engine to search ur own flash site?
Do you guys have any links?

How To Build A Search Engine To Search Ur Own Flash Site?
Hey its Stuart here again.
How do you build a search engine to search ur own flash site?
Do you guys have any links?

Search Page With Search Result From Text File
I want to make search page with search result In Flash, Data will be come frrom TXT file. can any body help my or give me source(FLA)??

Search In Flash Using Atomz Search Services
does anyone have any information on using atomz search service using flash? please reply....
thank you

Search Flash Content In Search Engines
Do you have any experiance how to optimize flash site for search engines?

If swf contains text an links, how can i constrain search engines like Google,... to find this?

Thanks

Search Flash Content In Search Engines
Do you have any experiance how to optimize flash site for search engines?

If swf contains text an links, how can i constrain search engines like Google,... to find this?

Thanks

Flash Search Field - Atomz Search
I currently use Atomz for their search engine. A clients site as of now is all HTML, however I am buidling some flash elements which will incorporate a simple "search" field and submit button.

I will include the HTML, however I am unsure how to make a form in Flash to be able to include the hidden fields, etc. I hope this makes sense, and thank you in advance!

<form method="get" action="http://search.atomz.com/search/" name="search">

<input name="sp-q" class="textbox" id="sp-q" value="Search" size="15">
<input type="hidden" name="sp-a" value="sp1002ad5d">
<input type="hidden" name="sp-p" value="all">
<input type="hidden" name="sp-f" value="ISO-8859-1">

<input type="submit" name="Submit" value="Submit">
</form>

If someone could create a small file, or let me know where to place what code where, please let me know. Any help is greatly appreciated! As well, if you have paypal, I can send a little something for the help!

Search Help Text Search In Flash
Hello, i'm realy stuck, and I need help... read dead end , i need to make a search on my site in flash, and also i need to explain ... what i need , example, whole site is in flash, and i need when someone wonna to find something just type word or sentence and then find on my site, but not google find or something like that... i wonna something easy, like CTRL + F, but label with find button... if anyone can help me or give me a guide i will be so happy, so thanks

sorry for my english... I hope it's readable )

Flash Lite Nested 'dynamic' Movie Clip Names Aka Why Must Flash Lite Destroy Me?
Hi.

I'm having problems defining the properties of a nested movie clip

beaconmap_search_mc.eval(curMapPlace)._alpha = 50; is the offending line

eval(curMapPlace) being the nested movie clip

It says I have to export is as flash 5 for it to work.
Seems ok according to this page:
http://www.adobe.com/devnet/devices/articles/as_flashlite_03.html
I have also tried using /: syntax, same problem.

It works when the nested movie clip name is named outright
(for example: beaconmap_search_mc.C1._alpha = 50;)
so I'm obviously doing something horribly wrong there.

Does anyone know where I'm going wrong?

I've had a few too many glasses of wine and a few too many hours on this assignment to work it out myself. And in general am just an awful programmer.

No Search On Search Engines How To Do It
i i made some sites of well known people a site for their family party and they do not want all the world to see it just friends how can i have it on the net and stop the search engines from finding it
i saw it once one can code in no search or no index or something ,does anyone know
id appreciate it
thanks
faith

What To Search For
This my first post. I would like to try and find the answers to my specific questions via the site knowledge base, but I am unsure of the exact words to use for my search. I am the consumate "gotta figure it myself" person. I want to create a series of text buttonsin a table that when on a mouse rollover or maybe click, another cell in the table shows text. What is this exactly called? I did find a good tutorial that explained the process of making the button and applying actions. I am confused on how to make a series (10-15) of different text buttons to all show at the same time, but only to show the correstponding text when there is a click or rollover in the same seperate table cell.
I hope that I explained that alright. I just need a push in the right direction.
Thanks in advance.

Search - Is It Possible?
Hi,

I need to know if this is possible or not...

There are 300 (for example) *.jpg and *.txt files like clip1.jpg, clip1.txt, clip2.jpg, clip2.txt....... The *.txt file includes some information like;

clip1.txt
---------
QT=1
&RP=0
&MP=0
&Name=Wales
&Info=Here will be the description of the picture mostly in one paragraph.
-----------

What I need to do is make a search within all those *.txt files and take the result to Flash to show related pictures in Flash. To read all of those *.txt files takes a long time with Flash and I also do not know if it is possible to make a search within the variables in a fast way.

If I make all of them only one file then it will be a *.txt file around 50-60 Kbyte and like;


clips.txt
---------
QT1=1
&RP1=0
&MP1=0
&Name1=Wales
&Info1=Here will be the description of the picture mostly in one paragraph.

QT2=0
&RP2=1
&MP2=1
&Name2=My Cats
&Info2=Here will be the description of the picture mostly in one paragraph.

QT3=0
&RP3=1
&MP3=0
&Name3=White Flowers
&Info3=Here will be the description of the picture mostly in one paragraph.

........
....
.

-----------

What I need to know is if it is possible to use something outside that Flash can get the list of related picture files?

Any ideas or suggestion will be appreciated...

Thank you...

Is There A Search Possible?
So i've got new problem...

I have 2 build up a little search in my flash page... so i could write in the keyword, for example "bla bla", submit it, and getting my bla bla.swf loaded. Is it possible? Plz help, who knows something about it... Even if You think, or are informed that kind of search is not possible, plz let me know, so i wont try 2 make things out no mo...

Thank You

Don't Know How To Search For It...
Here's what I want to do:

Make a test that has multiple choice answers. When the test is completed, the score is totalled and the user sent to a page (explaination of what the score means) based on the value of the score.

I have seen flash movies do this and although I'm asking on the newbie board, I've been using Flash for a couple of years now but only for basic presentation type of movies. In other words, I'm a newbie to this area of flash. Where do I begin looking? I was trying to find a tutorial but I don't know what to look for. OR, if you know how I can do this, I would greatly appreciate it.

Search XML
Can anyone post a code that will allow me to search an XML..

The XML contains the following data..

First and last name (1400 of them)

with arg1="student number"

I have an xml viewer which displays all of the in the XML

I just need a simple code that will allow the data to be pulled based on arg1="their student number or first and last name"

If you can help..I appreciate it

thanks@!!

Search Help
Hi

This is GugZ again

I just want to know how to link my search from my website to some well known search engines. i have a dynamic input text box and button 'search'. how can search things in the net by entering something from my website. its pretty simple I feel but I dont know how to do.

Please help.

regds
GugZ
INDIA

Where To Search
i need one software which convert my text file from ansi to unicode.

where i search for it.

is there any forum which help me.

thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved