531 Forum Posts by "RadRacer"
Anyone? Does it not make sense or something? Tell me what your confused about if thats the case.
Looking at the code longer I can see that this is the important part right here:
for(var i:int=0;i < n;i++)
{
if(node.childNodes[i].nodeName=='item')
{
var s:int=int(node.childNodes[i].childNodes.
length);
for(var j:int=0;j < s;j++)
{
if(node.childNodes[i].childNodes[j].node Name=='description')
info_ta.htmlText=node.childNodes[i].chil dNodes[j].firstChild.nodeValue;
}
}
Basically what I guess I am asking is how do i tell it to display a 'childnode' into a different textArea? I don't want everything to appear in the same textArea box, I want them in different ones so I can rearrange, reformat, and resize at will. Does that make sense?
Hello, I am trying to create my own weather program using yahoo's weather RSS feed. I've been following the tutorial on this site and everything is working as it should.
The thing is I want to break out the different elements . . . for example I don't want it to read 'full weather forcast provided by yahoo' at the end and I want the following days weather to be displayed in seperate textAreas. I'm new to AS3 and the code isn't really making sense to me, I was wondering if someone could help tell me how I could do this.
Here is Yahoos Astro Library . . . any help is really appreciated.
Here is the code:
var location_id:String='CAXX0246';
var grades:String='c';
var url:String='http://weather.yahooapis.com /forecastrss?p='+location_id+'&u='+grade s;
var richiesta:URLRequest=new URLRequest();
var loader:URLLoader;
richiesta.url=url;
richiesta.method=URLRequestMethod.GET;
loader=new URLLoader();
addListeners(loader);
try
{
loader.load(richiesta);
}
catch (error:Error)
{
trace('Unable to load requested document.');
}
function addListeners(d:IEventDispatcher):void
{
d.addEventListener(Event.COMPLETE,comple tato);
}
function completato(evt:Event):void
{
var vars:URLVariables=new URLVariables(evt.target.data);
var r:XML=new XML(evt.target.data);
var myXML:XMLDocument=new XMLDocument();
myXML.ignoreWhite=true;
myXML.parseXML(r.toXMLString());
var node:XMLNode=myXML.firstChild.firstChild ;
title_txt.text=node.firstChild.firstChil d.nodeValue;
var n:int=int(node.childNodes.length);
for(var i:int=0;i < n;i++)
{
if(node.childNodes[i].nodeName=='item')
{
var s:int=int(node.childNodes[i].childNodes.
length);
for(var j:int=0;j < s;j++)
{
if(node.childNodes[i].childNodes[j].node Name=='description')
info_ta.htmlText=node.childNodes[i].chil dNodes[j].firstChild.nodeValue;
}
}
}
}
I was going to post the file so anyone could just edit it directly but for some reason putfile.com now redirects me to ebaumsworld . . . first he steals other peoples contents now popular url's. jeesh.
Here's my Digg account I usually just use it to try and promote my own youtube videos (with little success) but I would be happy to digg any Newgrounds cartoons I feel are good enough to deserve my digg.
the second website I linked has a flash file that takes up all of the browser (right click anywhere and you will see that it is flash). If you resize your browser window the flash still takes up all of the browser, no matter how far you expand it. The actual content of the flash remains centered and does not get distorted.
How do you do this?
This is probably a clearer example of what I mean, if you open it and play with your browser window you will see the flash expands but the content itself in the centre does not.
Hello, I am trying to create an online portfolio and I want to do something simular to this website
When you resize your browser window the size of the flash document changes (you'll notice if you right click anywhere on the screen you get flash options meaning the flash document takes up 100% of the space). The size of the flash document resizes to match the browser window size but does not resize or distort the content inside of the flash swf.
Does anyone know how to go about doing this?
oh snap, sorry Anthony. I tried it on the frame and it worked! Thank you so much!
At 9/30/08 05:42 PM, anthony777w wrote: Then put this code on the frame with the button
_root."secretbutton".useHandCursor = false;
This should work
It's not working for me. The button (which has a instance name of 'coverup') is inside a movie clip which has an instance name of 'disablebuttons'.
so I am using the code:
_root.disablebuttons.coverup.useHandCurs or = false;
on the main timeline, but it dosen't seem to work. What am I doing wrong?
At 9/30/08 04:33 PM, xedon wrote: You could just use a movieclip which doesnt have the rollover mouse.
I can't actually. You see I was having trouble explaining why I needed to disable the rollover mouse for the button so I made up a fictional story that it was a secret button for ease of explaining. Here is why I really need it:
I am making a dress up game for my work, where instead of dragging clothing onto the character you toggle it on and off. For example he has an 'eyes' movieclip which starts on an empty first frame. By pressing a right arrow it changes the frame to frame two which has a set of eyes, hit it again and you get frame three with a different set of eyes ext. There is a button which the user presses called 'what program do I belong in?" and the computer then figures out what clothes your wearing and which program is best suited for someone wearing those clothes, and provides you with an answer as well as a link to the website for that college program.
What I need is to create a white background that will disable all the other buttons behind it. I've been using a giant white button, but I want to change it so that the user does not get a rollover mouse while overtop of it. A white movieclip will not work because the user will get a rollover mouse when he rolls over the buttons present behind it. I cannot simply move to a new frame because I want it so that when they press the back button it shows their character dressed up as they had left him.
See why I chose to say it was a secret button rather than explain that? Now can anyone help me?
HI all, I was wondering if there was a way that I can keep the curser from changing to show something is clickable (a button). I want it to be a hidden button so the user won't know about it unless he/she clicks there for some reason.
There are other buttons that I still want the curser to change when the user rolls over, I just want this one specific button to not change the curser.
Is there a way to do this?
At 9/18/08 08:01 PM, DarkMana wrote: Math.max( num1, num2, num3, ... );
Easiest way to get the highest value, though doesn't tell you which variable contained that value.
I like this solution better than the second one you posted (because to be honest the second one dosen't make sense to me, this one seems to be pretty clear). Once it determines the Max is there a way to change that into a variable?
for example would this work?
highestscore = Math.max;
If that works then I could use if statements to compare 'highestscore' to all the different variables and discover which program had that score, then show the user a message saying 'you belong in such and such a program). So the code would be:
If (agriculture = highestscore)
{
_root.yourprogram.gotoAndPlay (2);
}
it's not working for me, I am so confused.
this is my code
array = new Array(englishlanguage,agriculture, engineering, environmental, liberalarts, trades, business, mediadesign, health, human, justice, upgrading, citizenresearch, sports);
for(i=0;i<a rray.length-1;i++)
{
for(j=i+1;j<array.length;j++)
{
if(array[j]>array[i])
{
temp=array[j];
}
if(array[i]>array[j])
{
temp=array[i];
}
}
}
Basically I modified your code so that temp contains whichever number is higher.
However I get these errors:
Statement must appear within on handler for array = new Array (enlgish language, ext.)
Statement must appear within on handler for for(i=0;i<array.length-1:i++)
what does that even mean?
I've been looking up arrays on other website, and found this:
name_of_array = new Array("value1","value2","value3");
So if I did the same thing but replaced "value1" with a variable would that work? For Example:
name_of_array = new Array(agriculture, liberalarts, engineering);
sorry I'm new to arrays . . . is there a way I can convert the 14 variables I currently have into an array?
For my job I am creating a flash multiple choice quiz, to determine which college program one should take. Certain answers to the questions give points to a certain variable such as 'agriculture' or 'liberalarts'. There are 14 different variables in total. The variable with the most points should relate to which program is best for you.
What I need help with is figuring out the actionscript so that at the end of the quiz it determines the one with the highest point value, so that I can then display back to the user "you belong in [insert program name]" also I need to show the programs with the second and third highest point values
If anything is unclear just ask.
Any help would be very appreciated.
Nevermind I figured it out. I just have it so that everytime you zoom in or out it repositions itself to the centre of the map, its not great but it works
I tried adding this at the end of the actionscript:
_root.everything.moveTo (-81.0, -110.5);
but it dosen't seem to do anything, does anyone know why?
I can't use the v-cam though because I don't want everything in the flash document to scale up or down. Like for example the zoom buttons on the side I don't want them to be scaled with the map, they should always remain on the right hand side (and they do with how I have it set up now), and its not only that, I have buttons for turning on/off doorways, stairways and the like that cannot be scaled.
Thanks for trying to help though.
At 6/4/08 12:37 PM, mwmike wrote: I don't know the code but couldn't you have a maximum to zoom out of.
That dosen't even really work because say you are at normal zoom (100) then you zoom in (120) and move as far right as you can. When you zoom out again it zooms out from the middle point of where you were zoomed in on, so it will zoom out and show the whitespace around the map.
ps here is the code for one of my zoom buttons incase you need it.
on (press){
setProperty ("everything", _xscale, "160");
setProperty ("everything", _yscale, "160");
}
for those of you who havent read my past help topics:
I'm creating a map, The map covers the whole flash stage and can be zoomed in and out. Once it is zoomed in and out the user can move around in the map, up till he reaches the edge and then cannot move past the edge to whitespace (thats what I had problems with).
But now I have a new problem:
When zooming out it will show white space. For example if you zoom in all the way and move as far right as you can, then zoom out . . . it will show a ton of white space. How can I get it to stay within a border I specify? Or even if I could get it to centre around the middle of the document when I zoom in/out that would work as well.
nevermind, my cunning brain solved my own problem. I made a new movie clip, put some code in the zoom in/out buttons to change to a certain frame on each zoom level. On each frame in this movie clip I put different actionscript to limit the movement.
But I have a new question . . . For a new thread I think (all the experts have looked at this one already, and probably aren't going to come back to it)
I am creating an interactive map where the user can zoom in closer to it and zoom out as well. This is done using the following code (this is the zoom in button, code for zoom out is the same but has )
on (press){
setProperty ("everything", _xscale, "120");
setProperty ("everything", _yscale, "120");
zoomlevel.gotoAndStop(4);
}
//The last line with 'zoomlevel.gotoAndStop(4);' just tells a movie clip to go to its fourth frame, which highlights the zoom button they just pressed so they know what zoom level is active.
now to move the map left and right I have the following code (this code is to move left)
moveLeft.onPress = function() {
if (_root.everything._x < -20) {
everything.onEnterFrame = function() {
this._x += 4;
}
}
moveLeft.onRelease = function() {
delete everything.onEnterFrame;
}
}
It may seem weird that when the person presses the moveLeft button the map (named 'everything') moves to the right, but imagine you are filming a map and you grab it and push it to the right but the camera remains stationary. To whoevers watching on the other end it would seem like the camera moved to the left.
SO ON TO MY PROBLEM:
the code for moving around works fine for the default zoom level, it stops at the end of the map and wont go any further, BUT when it is zoomed in it stops too early and when I am zoomed out it goes past the edge of the map.
Is there any way I can set a variable so that the movement is limited to agree with the current zoom level?
so it would be
if (_root.everything._x < variablename) {
At 6/3/08 08:32 PM, Woadraiders wrote: Uh, maybe you want to try this:
moveLeft.onPress = function() {
if (_root.everything._x < -80) {
everything.onEnterFrame = function() {
this._x += 4;
}
}
moveLeft.onRelease = function() {
delete everything.onEnterFrame;
}
}
instead of what you wrote in your post.
Thanks dude! It worked like a charm. Well kind of, you can still move left forever if you hold down the button, but like if you press it for just a while then try pressing again it works :D so thats good enough for me
So I have a giant map, bigger than the movie clip area which has arrow buttons to move left right up and down. I want to put a restriction on this movement so that when it reaches the top of the map you cannot move up anymore, when it reaches the left hand side of the map you cannot move left anymore ext.
The movie clip is called "everything"
As the code currently is it will scroll left forever without restrictions
Here is the code that I have for moving left, with the restrictions.
*( _x +=4 moves the map movie clip to the right, giving the impression to the viewer that the area being viewed is moving to the left. Think of it as if you were filming a map, you grab it and move it to the right . . . the viewers at home would think the camera just moved to the left)*
if (_root.everything._x < -80) {
moveLeft.onPress = function() {
everything.onEnterFrame = function() {
this._x += 4;
}
}
moveLeft.onRelease = function() {
delete everything.onEnterFrame;
}
}
The starting position of the movie clips x value is -81. If I change the code from in the first line '-80' to '-82' then the movieclip will not move at all.
Anybody know how to fix this?
At 5/20/08 05:15 PM, Vorlek wrote:I think, you need the else action in there.
on (press) {
if (_root.levels == 1){
_root.stairs.gotoAndStop (2);
}else{
if (_root.levels == 2){
_root.stairs.gotoAndStop (3);
}
}
No still didn't work, I don't think the else action is needed anyways though (although I would happily admit I'm wrong, I'm still learning actionscript)
At 5/20/08 04:06 PM, West-End-Pro wrote: if(_root.levels == 1)
Use == to compare.
Thanks for that, should have caught that myself. For some reason however it still isn't working :(
I have a button with the following code.
on (press) {
if (_root.levels = 1){
_root.stairs.gotoAndStop (2);
}
if (_root.levels = 2){
_root.stairs.gotoAndStop (3);
}
}
What I want to happen is when the button is pressed I want it to check a movie clip (levels) to see if it is on floor one or floor two. If "levels" is on frame one then I want the movie clip "stairs" to move to the second frame . If "levels" is on frame 2 then I want "stairs" to move to frame three.
As of right now it is not working, does anyone know what I am doing wrong?
I don't have FL . . . I use sony acid and audacity, but I also got access to garageband and protools at school. anyone know how to do that with those programs?

