Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 10-25-2011, 05:53 AM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
Menu Code in Flash..

Ok so I am trying to get my menu to link in flash and I found this tutorial and I have the code working perfectly, no errors are coming up in flash anymore but when I test the movie the buttons won't do anything or go anywhere. Is there something else I need with this code? Here are the codes I am using.

Flash Code
PHP Code:
textFile = new LoadVars()
textFile.onLoad = function(){
buttonlink1 this.link1;
buttonlink2 this.link2;
buttonlink3 this.link3;
buttonlink4 this.link4;
}
textFile.load("mylink.txt");

btn1.onRelease = function(){
getURL(buttonlink1"name_txt");
};

btn2.onRelease = function(){
getURL(buttonlink2"name_txt");
};

btn3.onRelease = function(){
getURL(buttonlink3"name_txt");
};

btn4.onRelease = function(){
getURL(buttonlink4"name_txt");
}; 
name_txt is the name of the text box on the flash page that I am trying to get the pages to load into. I thought maybe that was the problem and tried changing that part to _self but still nothing.

txt document
HTML Code:
&link1=/pgone.xml &link2=/pgtwo.xml &link3=/pgthree.xml &link3=/pgfour.xml
I thought maybe the xml files could be the problem and tried changing those to an actual url and still nothing.

I don't really want to give up on these links because it is the closest I have gotten yet to having these links working.

Any help would be greatly appreciated

Oh and here is the original code for flash
PHP Code:
textFile = new LoadVars()
textFile.onLoad = function(){
buttonlink1 this.link1;
buttonlink2 this.link2;
buttonlink3 this.link3;
}
textFile.load(\”mylink.txt\”); // mylink.txt is your external text file

//—actionscript for buttons
//—make sure you have all your buttons instance name added. btn1, btn2 and btn3.

btn1.onRelease = function(){
getURL(buttonlink1, \”_self\”);
};

btn2.onRelease = function(){
getURL(buttonlink2, \”_self\”);
};

btn3.onRelease = function(){
getURL(buttonlink3, \”_self\”);
}; 
I had to remove the \ because I get this error when they are there... Operator '=' must be followed by an operand. and ')' or ',' expected. so I tried to change the \ to a \\ and got the same errors.

Last edited by snakeair; 10-25-2011 at 04:18 PM.
 
Reply With Quote
  #2 (permalink)  
Old 10-25-2011, 02:57 PM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
500+ people viewing this forum and no one knows?
 
Reply With Quote
  #3 (permalink)  
Old 10-25-2011, 04:19 PM
snakeair's Avatar
Super Moderator
 
Join Date: 12-31-07
Location: Medford, NJ
Posts: 42,213
iTrader: 3 / 100%
Please be patient, when someone is able to help you, they will respond. Some of the views are the search engine spiders also.

I'm not a programmar btw.
__________________
Newbiz Advertising - A resourceful blog

Like us on Facebook: facebook.com/Newbizshop

Premium WordPress Themes - A list of themes.
 
Reply With Quote
  #4 (permalink)  
Old 10-25-2011, 05:13 PM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
yeah sorry I have a world of patience it is just running thin lol I have been trying to get all this xml stuff going for like 4 days straight now I learn quickly and have fixed half the battle of what im trying to achieve but now I am at a dead end lol
 
Reply With Quote
  #5 (permalink)  
Old 10-28-2011, 08:25 AM
gammaRascal's Avatar
Artist & Motion Designer
Latest Blog:
None

 
Join Date: 05-31-04
Location: RI
Posts: 6,543
iTrader: 10 / 100%
Try changing them back to _self and use absolute urls in your txt file, so:

Quote:
btn1.onRelease = function(){
getURL(buttonlink1, "_self");
};
for

Quote:
&link1=http://www.yoursite.com/pgone.xml
 
Reply With Quote
  #6 (permalink)  
Old 10-28-2011, 12:14 PM
gammaRascal's Avatar
Artist & Motion Designer
Latest Blog:
None

 
Join Date: 05-31-04
Location: RI
Posts: 6,543
iTrader: 10 / 100%
Wait... I think you need to clarify the intent here. At first I thought you wanted to navigate the user to another location with a button press but upon rereading it, I'm getting the impression you want to populate a dynamic text field with the contents of an XML file. Can you clarify exactly what it is you want to do?
 
Reply With Quote
  #7 (permalink)  
Old 10-29-2011, 08:51 AM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
Yes I want to click on a button and send the xml file to a dynamic text box on the page. That way it doesn't have to reload the whole flash page again to change pages. The actual layout I am trying to do this on can be viewed here. http://www.js-pyrography.com/lightning.html
 
Reply With Quote
  #8 (permalink)  
Old 10-29-2011, 10:25 AM
gammaRascal's Avatar
Artist & Motion Designer
Latest Blog:
None

 
Join Date: 05-31-04
Location: RI
Posts: 6,543
iTrader: 10 / 100%
Okay... Lets step back for a second.

You want to load a .txt file which has a link [in the txt file] to load an xml file to populate a dynamic text filed. I've been trying to think of reason you'd want to do this but I can't. So let me take this back to the beginning.

If the basic idea is to populate a dynamic text field make a txt file with the content instead of a text file with a link to the content [two separate files] that in an xml OR call the xml directly. Either pick txt or xml - there's no reason to do both.

If you go with a txt file:

Code:
myDoc = new LoadVars(); myDoc.onLoad = function() { ///calls the first ref to load into the filed upon flash load ///since we want to have something there when the page loads myText.text = myDoc.link1; ///set all ref to a variable is one option - this is part of ///the success function so if the text file load, do this myTextVar1 = myDoc.link1; myTextVar2 = myDoc.link2; myTextVar3 = myDoc.link3; }; myDoc.load("myDoc.txt"); btn1.onPress = function() { ///upon button press, call variable which is equal to the ///content and displays it in the text field myText.text = myTextVar1; }; btn2.onPress = function() { ///another option - you can call the data directly by using a function ///call myText.text = myDoc.link2; /// notice i didnt use the variable name like btn1 but instead called ///the function we made earlier - myDoc - then added the ref ///name - link2 - to make the text field content be equal to myDoc.link2 }; btn3.onPress = function() { myText.text = myTextVar3; };

Attached working example.

How far does this take you?
Attached Files
File Type: zip readText.zip (9.2 KB, 3 views)
 
Reply With Quote
  #9 (permalink)  
Old 10-29-2011, 01:36 PM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
The txt thing was just a tutorial I tried and was the closest I have gotten to what I am trying to do. I really just want my buttons to load an xml file into the dynamic text box. See I want to sell my flash layouts but make them easy to edit for people without the program so I wanted to make xml files to hold all the content that people can just edit without going into the flash program to do it. I know its possible because I have downloaded flash templates that do the same thing but I can't figure out what they did so I turned to tutorials.
 
Reply With Quote
  #10 (permalink)  
Old 10-29-2011, 02:00 PM
gammaRascal's Avatar
Artist & Motion Designer
Latest Blog:
None

 
Join Date: 05-31-04
Location: RI
Posts: 6,543
iTrader: 10 / 100%
Fair enough. Sorry I couldn't help.
 
Reply With Quote
  #11 (permalink)  
Old 10-29-2011, 02:19 PM
Junior Member
 
Join Date: 10-24-11
Posts: 11
iTrader: 0 / 0%
Oh I am sorry I haven't gotten a chance to try your coding yet, I downloaded it but have been doing laundry and taking care of my baby lol I just was letting you know the exact thing I was aiming for Thank you so much for the help ^_^
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why is my menu bar behind my flash? drew68 Web Usability 14 08-25-2006 01:47 AM
Flash navigation menu white-raven Graphic Design Forum 1 01-10-2004 10:02 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:24 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.