Action Script Code Needed
I need a code that when a viewer clicks it will send them from scene 1 to scene 2.
FlashKit > Flash Help > Flash Newbies
Posted on: 07-30-2003, 12:00 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
HELP Action Script Needed Please
Can any one tell me the code to print an image in a flash movie with the use of a button in the same movie so that when pressed it will print out the image. It also needs to fit on the paper when printing?? If you can help i would be greatful as im trying to put a family photo album together using a single movie. It works where each set of thumbnails are on a single frame and each act as a button which once pushed take the viewer to another frame where there is an enlarged photo of the thumb, it is here i would like to include a button to print this image. Thanks
SIMPLE Action Help Needed..
OK, so I've designed basic websites before, using Dreamweaver, and have decided to use Flash to make a CD-ROM cataloging all the issues of a magazine company I work for. I had drawn a background image that I wanted. ALL I want to do is have a row of letters on the bottom as buttons. You rollover a letter, and see a list of issues for that letter, and when you CLICK the letter, that list stays there, in a specified area (like a big white box i made in the background. Then, THAT new text is ALSO clickable to see the specific article. I thought that this would be REALLY easy, just basic, click-this-get-that, sorta thing...aint workin! I made all 26 buttons fo the letters, have them all under a "menu" symbol. my problem is getting the Actions to work so when you click on the button, the list pops up in the white area. (kind of hard to explain without pictures!). I'm sorry this got very long, but I've been racking my brains for TWO weeks trying to figuer this out. ..please....PLEASE, can someone help!? email me ANYTIME! thoth037@aol.com
will
Action Script Pro Needed
ok, i am using the scrollbar made in flash and when you click on a pic, i want the pic to pop up in another part of the flash movie. check out the fla for clarification. Thanx.
the fla
the swf
Action Script Needed
Does anyone know how to get an attribute system? Like 15 points speed, 12 power and so on? Kinda like the attributes at the start of this fun game http://www.newgrounds.com/portal/view.php?id=144166 needed desperately.
/root Action Needed? How
Ok this is how it is. Follow me...
I have a layer on the timeline called middle. Here I have placed a movieclip called none. I have labeled frames within "none" but how do I script the action for the movie to play the frame I want within "none".
Overview one more time --- this is the structure
Layer Middle
movieclip none
frame "blank" inside none
How to tell the movie to play frame "blank"
Action Script Help Needed
Hi to all,
i have created presentation in flash with 1280 x1024 resolution.
the problem is that when i am swtich to 1024 x 768 res , the top and the bottom area of the presentation is going out side from stage and not visible. is there is any script that can automaticlly fit the movie 100 % of the monitor current resolution ?
An urgent help would be highly appriciated.
thanx in advance
Regards
Muhammd Imran
Action Scripter Needed =]
Anyone who is good at action scripting, but no good at drawing, lemme know. I'm pretty good at drawing a flash, and we can collaborate to make something Just make sure you're no noob to programming lol.
Art in other programs are found on http://soul-sama.deviantart.com/
Pictures on more detailed programs are found there, but I can give out my flash work files as well, so you know the quality. Thanks so much if you wanna collaborate!
Help Needed With Action Script...i Think
I have a star hanging from a rope which is static.
I want it to start swinging when the mouse rolls over it, and stop when the mouse is no longer over it.
How can i achieve this?
Help With Action Script Needed
Hi!... a million thanx to whoever can help me out...this site is half way done but I seem to be having some problems, if I go to the transport button and keep interchanging between the two options the buttons for scrolling or forward keep freezing up after some time...not immediately, I am going nuts trying to solve this can someone tell me where I am going wrong, all the files source, text and html are (in two zipped folders) extract them into one folder and try the html.
Action Help Needed ASAP
Hi,
I have to get this website up by tomorrow. Here is the link. http://www.bayoulandadvertising.com/...g/wedding1.swf
The ads are still hard to read, so I would like to have each ad pop up larger if you put the mouse over it.
Where do I start????
Thanks,
Tracy
Simple Action Help Needed
I'm attempting to make a simple drawing that does something when you click on him. The problem is, this is my first time using flash, and I can't find any helpful tutorials. The script I'm using right now is 3.0, and the following text:
on(release)
{
GoToAndPlay("Click")
}
'Click' is the frame label I want it to go to when clicked on. I keep getting an 'unidentified' error when I try to use it, though. Any suggestions?
[F8] Action Script Help Needed
Hi guys,
I am creating one flash movie
I need a text rotation around the moving object.
I know about static object animation.. but looking for scripting.. part.
Action Script Needed
Hi i was wondering if ome one could write me a scrpt. i need a Move clip to move in a random direction and when it hits some thing, it moves in a diffrent random direction. i was thinking of using a while loop to make it move untill it hits a wall then moving in a nother random direction
Action Scripting Needed
I have a project I'm doing and I can't seems to figure out the coding that is needed to make part of it work. The project is a character simulator. I hope to make this clear enough.
The problem is I have several thumbnails on my stage and when you click on a certain image another image will pop up on the other side of the stage in a certain spot. What I want is to have it where you can click these buttons and have the image come up while at the same time have another group of buttons that change the image according to the image that was originally pressed.
Another example is I have buttons that will bring up a hair style and there are around 20 of these buttons. What I want to do is set up another group of buttons that will change the color of the hair (change the image to the color hair image.) I don't know how to make the code recognize the image of the hair pressed and the change color hair image at the same time.
An example is on this page...http://www.ragnarokcs.com/ragnarok-character.php
There is a head hair change with also a hair color changer.
If someone can help that would be most helpful.
Action IF THEN Statement Help Needed.
I am working on a simple reply bot for the holidays, and I am having trouble with some IF THEN statements.. I have attached the code as so far.
I am looking to be able to have the script look for certain words in the user text field, and reply accordingly. I understand this uses the indexOf command, but I am not yet skilled enough to use it.
It would be a HUGE help if anyone could shed some light on the subject.. Thanks in advance!!!
Here is what I have so far:
Attach Code
on (release, keyPress "<Enter>") {
if (_root.user.text == "1") {
_root.reply.htmltext = "<b>Santa Clause: </b> I got your Test number 1";
} else {
_root.reply.htmltext = "<b>Santa Clause: </b> I do not understand.";
}
if (_root.user.text == "2") {
root.reply.htmltext = "<b>Santa Clause: </b> I got your Test number 2";
} else {
_root.reply.htmltext = "<b>Santa Clause: </b> I do not understand.";
}
gotoAndPlay(2);
}
Action Script Help Needed
I have this simple animation with a little bit of action script attached. The animation will not work when its loaded dynamicly into a main.swf movie.
what do I change in the action script to make this work as an external movie, dynamicly loaded into a main movie.
please any ideas.
Help With Action Script Needed
Hi!... a million thanx to whoever can help me out...this site is half way done but I seem to be having some problems, if I go to transport and keep interchanging between the two options the buttons for scrolling or forward keep freezing up after some time...not immediately, I am going nuts trying to solve this can someone tell me where I am going wrong, all the files source, text and html are (in two zipped folders)
Action Script Help Needed
I need to make a hit test that will state if(this.hitTest(_root.// this is the part I need, I want it to be _root.mc+any instances made due to attaching of this mc. (the instances being "bob"+i and i being ++; the whole time)\)
Can any body help with this?
Action Script And XML Help Needed
OK I have been going down one road for this and have taken a few wrong turns.
A few things about what we are looking at:
I am using Flash CS3 but I am using Action Script 1.0/2.0 for compatability purposes.
What I have been able to do so far is create random instances of a movie clip to appear over a set amount of time but I need to go a bit further. The web application needs to be updated regularly and the best way I can think of doing that is with keeping all the variables in an XML. The problem is I am not sure how to format the XML properly to get Flash to read it and load the variables.
I am creating an online version of a vision screening tool we use. The test is graphically simple just a collection of a few primitives on a dark background. There are basically two objects a fixation point and a stimulus. What I need to be able to do is this.
Display either movieclip at (x,y) for (z)ms where x,y,& z are all variables loaded from an xml. I have asked questions along this line before but this is a different scope in case anyone wants to claim I double posted, this is quite different than they way I was doing it before.
Any help with the XML or even any actionscript suggestions would be greatly appreciated.
Thanks
Action Scripting Needed
I have a project I'm doing and I can't seems to figure out the coding that is needed to make part of it work. The project is a character simulator. I hope to make this clear enough.
The problem is I have several thumbnails on my stage and when you click on a certain image another image will pop up on the other side of the stage in a certain spot. What I want is to have it where you can click these buttons and have the image come up while at the same time have another group of buttons that change the image according to the image that was originally pressed.
Another example is I have buttons that will bring up a hair style and there are around 20 of these buttons. What I want to do is set up another group of buttons that will change the color of the hair (change the image to the color hair image.) I don't know how to make the code recognize the image of the hair pressed and the change color hair image at the same time.
An example is on this page...http://www.ragnarokcs.com/ragnarok-character.php
There is a head hair change with also a hair color changer.
If someone can help that would be most helpful.
Action Script 3 And XML Help Needed
Hi
I am new flash and action script and wanted to complete a very simple task in flash 3.Basically i have my xml document of recipes which i have shown below:
<Recipes>
<Recipe>
<Category>Chinese</Category>
<Ingredients>
<Ingredient>
<name>test</name>
<quantity>1</quantity>
<measurement>g</measurement>
</Ingredient>
<Ingredient>
<name></name>
<quantity></quantity>
<measurement></measurement>
</Ingredient>
<Ingredient>
<name></name>
<quantity></quantity>
<measurement></measurement>
</Ingredient>
<Ingredient>
<name></name>
<quantity></quantity>
<measurement></measurement>
</Ingredient>
<Ingredient>
<name></name>
<quantity></quantity>
<measurement></measurement>
</Ingredient>
<Ingredient>
<name></name>
<quantity></quantity>
<measurement></measurement>
</Ingredient>
</Ingredients>
<Method>
<steps>
<Step></Step>
<Step></Step>
<Step></Step>
<Step></Step>
<Step></Step>
<Step></Step>
<Step></Step>
</steps>
</Method>
</Recipe>
</Recipes>
Basically thisxml is an external file which i load into my flash file. All i want to to do is loop through the xml and ouput the valuesin each of the tags. Couldsomeone please helpme on this.I knowi have to use arays but can not find nocode examples.Any help would be much appreciated. I have also included the code i have in my fla file currently:
stop();
//test="hello";
//new xml code
import flash.events.*;
import fl.controls.TextInput;
import fl.controls.TextArea;
import flash.text.TextField;
import fl.events.ComponentEvent;
var output:String="";
//the variable to load the data from the XML file
var urlLoader:URLLoader=new URLLoader();
//create the variable for storing the XML data
var recipes_xml:XML;
//the variable to hold the location of the URL for the XML file
var urlRequest:URLRequest=new URLRequest("recipes.xml");
urlLoader.addEventListener(Event.COMPLETE,complete Loading);
urlLoader.load(urlRequest);
//loading of XML completed
function completeLoading(event:Event):void {
//when loading of XML completed, the data
//can go into the internal variable of type XML
recipes_xml=new XML(urlLoader.data);
//new code
//display the XML object recipes_xml as a text
//inside text area myxml_ta
myxml_ta.text=recipes_xml.toString();
format.text=recipes_xml.toString();
}
As shown in the above code i can get my textboxes to populate with the full xml but just want to be able to display the values in ALL the nodes. Any help would be appreciated.
PS: This is my first post so i hope this forum helps.
Many thanks in advance
Kam
Action Script Help Needed
I have this simple animation with a little bit of action script attached. The animation will not work when its loaded dynamicly into a main.swf movie.
what do I change in the action script to make this work as an external movie, dynamicly loaded into a main movie.
please any ideas.
Action Script For A Pre Loader NEEDED...BUT
Please let me know..... If there is any Action Script for a pre loader that gives the following(one for each)
a) Loading Time Remaining
b) Time estimated & Time tokk till now
Same above with Bytes loaded & viz..
So $ Questions Totally ... Got My point?.. Please HElp me......
I want these to be done within Flash Actionscript without using external files...
Thank you...... Awaiting your Reply
Viva
Preloader Action Script - Help Needed
Hi,
I download atutorial to creating my own preloader from flashkit.com.
http://www.flashkit.com/tutorials/Ac...12/index.shtml
To see if it worked I cheated and copied and pasted the .fla into a preloader scene in my own flash movie.
I just have one problem: Once the preloader has finished loading it goes to the next scene as desired but it starts half way through the scene. I had change the action script from :
loadedbytes=getBytesLoaded();
totalbytes=getBytesTotal();
loadedkbytes=Math.ceil (loadedbytes/1000);
totalkbytes=Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene (); <---- I changed this line (A)
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame); <---- And this line(B)
to (A) gotoAndPlay("Scene 2", 1);
and (B) gotoAndPlay(_root.frame);
yet it still didn’t work. Ive tried contacting the author but it was invalid email. Can you give me any advice as to why this might be, thank you very much.
Nick Halliday
Help Needed : SwapDepth Action, .fla Included...
you know that feeling of panik that you experience when you've got a deadline, and suddenly things stop going to plan well, you guessed it, i'm there, so i guess i'm just needing a little help with something simple i'm trying to work through
here's a small .fla moving i've knocked up as an example of what i'm doing download here
i basically have 4 buttons, each, when pressed, plays a movie clip on the main stage. what i'm trying to achieve with swapdeath, is when one of the 4 buttons is clicked, it brings the relative movie clip to the top, and leaves the order of movie clips below it alone, rather than moving the last movie clip to the back of the pile. this is all in place to create a 'wiping' effect, wiping the current movie clip over the last movie clip selected - get it?
well, d-load the .fla, and you'll see what i mean
cheers for any help
paro
Button Delay Action Help Needed
I have 5 buttons and 5 movies to load. Each movie enters and exits with movement. I need the buttons to tell the movie to play its exit action and at the end load the movie associated with that button. I have used the gotoAndPlay then loadMovieNum commands but both are executed immediately and the exit activity is not shown.
Can anyone assist me. thanks
Action Scripting Help Needed... MC Intro
I have designed an "intro" to my website and it works great and everything, but I now have a problem. On the "Main Timeline of the website" I have the intro as "one" frame (since it is a Movie Clip and it has a Stop() Action Script). The intro is of course on the first frame and then the website starts on frame "two" of the "main timeline".
I don't want to stretch the "Intro" on the main timeline... I was wondering if there is a way to use action script to tell the "Intro" when it's finished playing "ONCE" to go to the frame label (which is frame two anyway)on the main timeline (not the movie clip timeline). I have a "Skip Intro" button and that seems to be the only way I can advance to my website, due to the Stop() action written in the "Intro" movie clip.
Anyone know of a solution or will I have to stretch the Intro over the main timeline and match its frames numbers (which happens to be 655 frames). I don't like having too much stuff on the main timeline... I am just trying to keep it clean and easy.
Thanks.
Action Script Advice Needed
hi there, i've got the following fla. which loads images using a fadeIn function, could anyone show me how i could change the scripting so that it uses a fadeIn function and a _x movement function when the image is called.
Action Scripting Info. Needed
hello,
first time post.
i have made a collage of photos in photoshop 8" by 8". it is now placed on a webpage. i want to be able to click on each photo in the collage and have it load a webpage that has a larger image of that photo.
can someone tell me the action scripting process to do this? step by step? (if you leave out steps, in an attempt to explain without precision, of course it will not work.
also, i am on a macpro book intel, if that helps. and using flash mx 2004
thanks.
Help, Quicktime/.flv End Of Movie Action Needed
Hi, we've made a simple flash 8 presentation for a client that is essentially a branded main menu from which 9 different .flv training movies (converted with flash 8 from quicktimes) can be launched. Everything is working fine but we'd like to add in a an action script that would automatically return the user to the main menu when each movie file has completed playing. Right now we have a back button that they can manually click at anytime but ideally it would return automatically when the .flv is finsihed. Can anyone help? Much appreciated. Manny.
Help With Action Script Needed Thanks To Anyone Who Helps
Hey I would like to trouble shoot my action script
My action script sound won't work
Could you tell me if this is wrong or what might be wrong with my computer
dSound.setVolume(100);
dSound = new Sound(this);
dSound.attachSound(sound1);
dSound.start(4, 0);
cool smily faces could not help it
Simple Action Script Help Needed...i Think
I'm in the process of creating a website of rmy folio but and already struggling!! Although i have used flash quite a lot its always been for for very short periods so i'm a bit of hack when it comes to Action script.
attached in a small portfolio slider that i'm working on to be loaded externally in my site, it almost works except for the final problem that i can't solve. If you download and view the file you'll see that the panel slides off to the right so its out of view and then can be slid back into view by clicking the button again. I originally had this working fine by using motion tween, frame 1 - 15 slide to right, frames 16 - 29 slide back to left and then let movie run back to frame 1 and loop complete. But i found when it looped it reset the state of thumbnail previews to the default which isn't how i want it. I need the thumbnail previews to stay as they were when panel slides of screen. so i've now used prevFrame to reverse the back from frame 15 - 1, but now my button for sliding the panel in and out doesn't work as i need........... i been playing with were the actions are placed etc but can't get it sussed and could really do with someones help, i'm quite close i think but the last step has eaten my afternoon away!!
So if any of you would be kind enough to have a look at the the attched file and give me some advice it would be much appreciated. Once you see the file working i'm sure it make more sense than my long winded explanation
**edit** created in flash mx 2004 pro
many thanks
James
[Flash8]Action Script 2.0 Help Needed
Hi. Currently, i'm facing some action scripts problem. I need to create a flash which get the external/dynamic data from .txt, after getting data value and gotoAndPlay another scene. Below script seemed not workable.. Coz can't get the right variable and keep playing the wrong scene. Any flash expert willing to help me?
My text file content is :
point= 8000
Code is :
var myData= new LoadVars();
myData.load("details.txt");
totalpoint.text = this.point;
myData.onLoad = function(totalpoint:Number) {
if((totalpoint > 8000) && (totalpoint < 10000)) {
gotoAndPlay("Scene 5", 1);
} else if ((totalpoint > 7999) && (totalpoint < 6000)) {
gotoAndPlay("Scene 4", 1);
} else if ((totalpoint > 5999) && (totalpoint < 3000)) {
gotoAndPlay("Scene 3", 1);
} else {
gotoAndPlay("Scene 2", 1);
}
}
Thank you very much.
Hope get replies soon.
Help With Action Script Needed Thanks To Anyone Who Helps
Hey I would like to trouble shoot my action script
My action script sound won't work
Could you tell me if this is wrong or what might be wrong with my computer
dSound.setVolume(100);
dSound = new Sound(this);
dSound.attachSound(sound1);
dSound.start(4, 0);
cool smily faces could not help it
Levels & Action Script Help Needed
My main swf is called index.swf (level 0).
On top of this page, I load another swf called "other.swf" (level 2).
Inside of "other.swf" there is a movie clip called "page_videos" with an instance name of "player0".
Inside of this movie clip is a media Playback controller with an instance name of "playerZip".
The controller plays a flv.
When a button is hit (on a 3rd level), it unloads levels two and three, and returns you to a spot on the timeline of index.swf (level 0), but the audio from the media controler is still playing. Why is the movie still playing if the level has been unloaded? How do I get the movie in "playerZip" to unload? -rr-
Loader Action Script Help Needed
hi there .
I've setup a flash movie with a very simple loader and a set of buttons which on rollover set the content path of the loader. This is done using actionscript attached to the buttons.
on(rollOver) {
portfolio_loader.contentPath = "Page_00.jpg";
}
very simple !
Anyways I now want a button which functions as an "enlarge view" button. I need some script which will do a getURL depending on the currently loaded image in the loader.
So i.e. when contentPath = "Page_00.jpg" then getURL("Page_00_Large.jpg")
But i would need it to be able to do that with up to 30 different variables. Any help will be most welcome.
Thanks in advance.
Patch
Simple Action Script Needed
Hi - sorry this must be old hat to many - 2 questions for the price of one - I am developing a movie with 2 scenes for a web site. I can get the 1st scene is fine, but I can not find a script to have the 2nd scene played. The next Q I have is that I want to have the background music carried over to the 2nd scene. - thanks
Sound Action Script Needed....Please Help
Hai guys...it's me again....
i need a action script which can start and stop my website sound....
how can i do that?
can anyone please help me out?
i in a dilemma trying to figure out myself...
thanks....
Code Help Needed
I'm currently making a pool game in flash but am having a small problem with the code.(ie. getting the white ball to move) Can anyone help?
Movieclip.prototype.cadrer = function() {
// this._width=20+Math.abs(this.yspeed)/2;
// this._height=20+Math.abs(this.xspeed)/2;
this._xscale = this._yscale=100+(this.vitesse()/2);
this.oldxpos = this._x;
this.oldypos = this._y;
this.newxpos = this.oldxpos+xspeed;
this.newypos = this.oldypos+yspeed;
this.xspeed = this.xspeed*_root.friction;
this.yspeed = this.yspeed*_root.friction;
if (this._name == "ball1") {
_root.cue._alpha = 100-30*Math.sqrt((this.xspeed*this.xspeed)+(this.yspee d*this.yspeed));
}
// collision with sides
if ((this.newypos<_root.miny) or (this.newypos>_root.maxy)) {
this.yspeed = -1*this.yspeed*_root.friction;
this.newypos = this.oldypos;
} else if ((this.newxpos<_root.minx) or (this.newxpos>_root.maxx)) {
this.xspeed = -1*this.xspeed*_root.friction;
this.newxpos = this.oldxpos;
}
this._x = this.newxpos;
this._y = this.newypos;
Help Needed With Code
Hi:
Have a text field myText with a variable myText.. the data is loaded in the text field which looks like this
Notepad file:
&Tx1=This is line one
---------------------------------
Now here is the issue.. I am trying to format this text and read it from the file.. I have created an object which holds text..
MyVars = new LoadVars();
//Load the text
MyVars.load("test.txt");
-------------------------------------------------------
here is the code I'm using not sure where Im going wrong..
----------------------------------------------------------
function addItems() {
myText.multiline = true;
myText.wordWrap = true;
myText.type = "dynamic";
myText.background = true;
myText.backgroundColor = "0xFFCF63";
***This is where i think the problem lies..
myText = MyVars.Tx1; (not sure)
myText.htmlText = MyVars.Tx1; (Not sure but does not work data does not load)
ScrollBar.setScrollTarget(myText);
// The Next Part is just examples of applying style's to the Text Field and Scroll Bar component.
// The rest of this is optional - It just sets the stlye for the ScrollBar.
formStyleFormat = new FStyleFormat;
formStyleFormat.scrollTrack = "0x425984";
formStyleFormat.highlight = "0xffffff";
formStyleFormat.highlight3D = "0xffffff";
formStyleFormat.arrow = "0x425984";
formStyleFormat.face = "0xffcc66";
formStyleFormat.background = "0xffcc66";
formStyleFormat.shadow= "0x666666";
formStyleFormat.darkshadow= "0x333333";
// Apply the Changes.
formStyleFormat.addListener(ScrollBar);
formStyleFormat.applyChanges();
// Sets some of the Text Formatting Options..
textFormat = new TextFormat();
textFormat.color = "0x425984";
textFormat.bullet = false;
textFormat.underline = false;
textFormat.bullet= false;
textFormat.size = 5;
textFormat.font = "arial";
// Set Text Format.
myText.setTextFormat(textFormat);
}
Code Needed
sombody knows how do i amke a projector with out border and the minimize, restore down and close button?
there is a program calles flash jugler that makes that but i don't wan't to buy it just for that
Help Needed With Code
i have done this code
i have few buttons that should move up and down aon the half circle
so when i go over one the other move down/up and let me see the sub menu!
the problem is that iu get some mess
something one menu goes overthe other
and i have meanwhile closed other movments while 1 is moving u can go another button and change the movmnet direction which is not good too (beacuse i want it to move accoridnly where i am over that sec!)
thnaks in advance
peleg
Code Needed
OK i have a game with a scrolling background using this code:
if (Key.isDown(39))
{
this._x = this._x + 24;
_parent._x = _parent._x - 24;
I need a code so that when you want to restart the game you press enter and it restarts the whole flash. I tried puttin it to the first frame (BUT THE SCREEN HAD MOVED ALONG)
Please any help
[MX] Code Needed Pls
I am trying to find a code to allow me to open a new link ontop of my main page so i can keep the menu on screen etc
What I am after is a link that opens new flash files ontop of another flash file
- for example -
The main menu has all menu buttons etc when i click a link instead of opening a new page where I have to have the menus on that page it opens in a the orginal page - I did it while I was at uni but forgotten the code.
can anyone help
cheers guys
Code Needed
I'm trying to make a login in flash but i don't know how to code it.
I wonderd if you could help me.
You could post it here or mail it @ Grandfather_88@hotmail.com
Code Needed
I'm making a coder/decoder for flash to send secret messages to people with the same file but i don't know the code/encode script i was wondering if any of you know where to get it or could make it cuz i'm a actionscript n00b .
Pls reply as soon as possible.
Here or at my mail.
Grandfather_88@hotmail.com
::I will send you the swf/exe when it's finished(if you want)::
A Bit Of Code Help Needed...
hello everyone,
regarding the kirupa tutorial on the news editor found here:
http://www.kirupa.com/web/xml/examples/newseditor.htm
how do i edit the following code so the xml file displays only the date, and not the time? i can't figure it out....i tried deleting the .getTime, but that doesn't work.
thanks!
var max_news_items = 50;
GetTitleText = function(news_xml, entry_index){
var entries = news_xml.firstChild.childNodes;
var title_element = entries[entry_index].firstChild;
return title_element.firstChild.nodeValue;
}
GetBodyText = function(news_xml, entry_index){
var entries = news_xml.firstChild.childNodes;
var body_element = entries[entry_index].firstChild.nextSibling;
return body_element.firstChild.nodeValue;
}
GetEntry = function(news_xml, index){
var entries = news_xml.firstChild.childNodes;
return entries[index];
}
GetNewsCount = function(news_xml){
var entries = news_xml.firstChild.childNodes;
return entries.length;
}
ShowNews = function(news_xml){
if (!news_xml.firstChild.hasChildNodes()){
content_txt.text = "No news available.";
return (0);
}
var entries = news_xml.firstChild.childNodes;
content_txt.text = "";
for (var i=0; i<entries.length; i++){
var title = GetTitleText(news_xml, i);
var body = GetBodyText(news_xml, i);
content_txt.htmlText += entries[i].attributes.date + "<br>"
content_txt.htmlText += "<b>" + title +"</b><br>"
content_txt.htmlText += body +"<br><br>";
content_txt.htmlText += "¯¯¯¯¯¯¯¯¯¯<br>"
}
}
AddNewsEntry = function(news_xml, title, body){
var entryNode = news_xml.createElement("entry");
entryNode.attributes.date = new Date().toString();
if (title == "") title = "(none)";
var titleNode = news_xml.createElement("title");
var titleText = news_xml.createTextNode(title);
titleNode.appendChild(titleText);
entryNode.appendChild(titleNode);
if (body == "") body = "(none)";
var bodyNode = news_xml.createElement("body");
var bodyText = news_xml.createTextNode(body);
bodyNode.appendChild(bodyText);
entryNode.appendChild(bodyNode);
if (news_xml.firstChild.hasChildNodes()){
news_xml.firstChild.insertBefore(entryNode, news_xml.firstChild.firstChild);
}else news_xml.firstChild.appendChild(entryNode);
while (GetNewsCount(news_xml) > max_news_items){
news_xml.firstChild.lastChild.removeNode();
}
}
EditNewsEntry = function(news_xml, node_index, title, body){
var entry = GetEntry(news_xml, node_index);
if (title == "" && body == ""){
entry.removeNode();
return (0);
}else{
if (title == "") title = "(none)";
if (body == "") body = "(none)";
}
entry.attributes.date = new Date().toString();
var titleTextNode = entry.firstChild.firstChild;
var bodyTextNode = entry.firstChild.nextSibling.firstChild;
titleTextNode.nodeValue = title;
bodyTextNode.nodeValue = body;
}
SaveNews = function(news_xml){
content_txt.htmlText = "<i>Saving and Loading...</i>";
news_xml.xmlDecl = ""; // fixes duplication bug
news_xml.sendAndLoad(save_script, news_xml);
}
RefreshNews = function(news_xml){
content_txt.htmlText = "<i>Loading...</i>";
news_xml.load(xml_file+"?"+new Date().getTime());
}
A Little AS Code Help Needed...
hey everyone!
i'm trying to add an email field to a guestbook. i thought i had everything in order, but the entries won't "stick". in other words, after i add the info (name, email, message), it appears as a new entry in the guestbook, but after refreshing the page, that new entry is no longer there. can someone check my code and let me know why it's not permanently writing to the file?
thanks!
here is the code:
var currPage = 0;
var showAmount = 50;
// set this to the amount of entries you want to view at a time
previous._visible = false;
createMessage._visible = false;
createButton.onRelease = function() {
this._visible = false;
this._parent.createMessage._visible = true;
if (createMessage.nameField.emailField.text == "") {
Selection.setFocus(createMessage.nameField.emailFi eld);
} else if (createMessage.messageField.emailField.text == "") {
Selection.setFocus(createMessage.messageField.emai lField);
}
};
// **** Load XML ****************************
myXML = new XML();
myXML.ignoreWhite = true;
receiverXML = new XML();
myXML.onLoad = function(success) {
myXML.contentType = "text/xml";
if (success) {
this.showXML();
} else {
trace("Error loading XML file");
}
};
myIdentifier = Math.round(Math.random()*10000);
myXML.load("guestbook.xml?uniq="+myIdentifier);
receiverXML.onLoad = function() {
this.contentType = "text/xml";
_root.currPage = 0;
this.showXML();
};
createMessage.closeButton.onRelease = function() {
this._parent._visible = false;
createButton._visible = true;
};
createMessage.sendButton.onRelease = function() {
var myName = this._parent.nameField.text;
var myEmail = this._parent.emailField.text;
var myMessage = this._parent.messageField.text;
if (myName == "") {
this._parent.errorField.text = "please fill out your name";
Selection.setFocus(this._parent.nameField);
} else if (myEmail == "") {
this._parent.errorField.text = "please fill out your email";
Selection.setFocus(this._parent.emailField);
} else if (myMessage == "") {
this._parent.errorField.text = "please leave a message";
Selection.setFocus(this._parent.messageField);
} else {
myXML.firstChild.appendChild(myXML.createElement(" entry"));
myXML.firstChild.lastChild.attributes.myName = myName;
myXML.firstChild.lastChild.attributes.myEmail = myEmail;
myXML.firstChild.lastChild.appendChild(myXML.creat eElement("myText"));
myXML.firstChild.lastChild.lastChild.appendChild(m yXML.createTextNode(myMessage));
myXML.sendAndLoad("processXML.php", receiverXML);
this._parent._visible = false;
createButton._visible = true;
}
};
XML.prototype.showXML = function() {
myGuestbook.scroll = 1;
myGuestbook.htmlText = "";
var numItems = this.firstChild.childNodes.length;
var firstItem = numItems-(currPage*showAmount);
if (currPage == 0) {
previous._visible = false;
}
var lastItem = firstItem-showAmount;
if (lastItem<=0) {
lastItem = 0;
next._visible = false;
}
myCount.text = "Total messages: "+numItems;
if (firstItem == lastItem+1) {
nowShowing.text = "Showing message "+firstItem;
} else {
nowShowing.text = "Showing message "+firstItem+" to "+(lastItem+1);
}
for (i=(firstItem-1); i>=lastItem; i--) {
myGuestbook.htmlText += "<B>"+this.firstChild.childNodes[i].attributes.myName+"</B>"
myGuestbook.htmlText += "<B>"+this.firstChild.childNodes[i].attributes.myEmail+"</B> wrote:
";
myGuestbook.htmlText += this.firstChild.childNodes[i].firstChild.firstChild.nodeValue+"
";
}
};
previous.onRelease = function() {
currPage--;
myXML.showXML();
next._visible = true;
};
next.onRelease = function() {
currPage++;
myXML.showXML();
previous._visible = true;
};
Code Needed
I'm trying to make a login in flash but i don't know how to code it.
I wonderd if you could help me.
You could post it here or mail it @ Grandfather_88@hotmail.com
|