Redirection / Dynamic Text Field Issue

  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

Ok so what I've done is I've successfully read in cookie data and stored it in a variable inside Flash. I know it's getting in there, because I've been able to display the variable text directly in a dynamic field. However instead of just displaying the variable data, I want to do something with it. I've run it through an if statement with the following code:

Code: [ Select ]
///////////////////////////////////////
LOADED = Math.round(getBytesLoaded());
TOTAL = Math.round(getBytesTotal());
PERCENT = LOADED/TOTAL;
BAR._width = PERCENT*300;
TEXT = Math.round(PERCENT*100)+"%";
if (LOADED == TOTAL) {
///////////////////////////////////////
if (Bookmark==Home){
    IFBookmark = "Bookmark Found: Sending you to Home.";
    gotoAndPlay("Home", 1)
} else if (Bookmark==Biography){
    IFBookmark = "Bookmark Found: Sending you to Biography.";
    gotoAndPlay("Biography", 1)
}else if (Bookmark==Recognitions){
    IFBookmark = "Bookmark Found: Sending you to Recognitions.";
    gotoAndPlay("Recognitions", 1)
}else if (Bookmark==ServerSide){
    IFBookmark = "Bookmark Found: Sending you to ServerSide.";
    gotoAndPlay("ServerSide", 1)
}else if (Bookmark==ClientSide){
    IFBookmark = "Bookmark Found: Sending you to ClientSide.";
    gotoAndPlay("ClientSide", 1)
}else if (Bookmark==GraphicDesign){
    IFBookmark = "Bookmark Found: Sending you to GraphicDesign.";
    gotoAndPlay("GraphicDesign", 1)
}else if (Bookmark==ExtensiveWebDesign){
    IFBookmark = "Bookmark Found: Sending you to ExtensiveWebDesign.";
    gotoAndPlay("ExtensiveWebDesign", 1)
}else if (Bookmark==Presentations){
    IFBookmark = "Bookmark Found: Sending you to Presentations.";
    gotoAndPlay("Presentations", 1)
} else {
    IFBookmark = "No Bookmark Found: Welcome to my Portfolio!";
    gotoAndPlay(3);
}
///////////////////////////////////////
}
  1. ///////////////////////////////////////
  2. LOADED = Math.round(getBytesLoaded());
  3. TOTAL = Math.round(getBytesTotal());
  4. PERCENT = LOADED/TOTAL;
  5. BAR._width = PERCENT*300;
  6. TEXT = Math.round(PERCENT*100)+"%";
  7. if (LOADED == TOTAL) {
  8. ///////////////////////////////////////
  9. if (Bookmark==Home){
  10.     IFBookmark = "Bookmark Found: Sending you to Home.";
  11.     gotoAndPlay("Home", 1)
  12. } else if (Bookmark==Biography){
  13.     IFBookmark = "Bookmark Found: Sending you to Biography.";
  14.     gotoAndPlay("Biography", 1)
  15. }else if (Bookmark==Recognitions){
  16.     IFBookmark = "Bookmark Found: Sending you to Recognitions.";
  17.     gotoAndPlay("Recognitions", 1)
  18. }else if (Bookmark==ServerSide){
  19.     IFBookmark = "Bookmark Found: Sending you to ServerSide.";
  20.     gotoAndPlay("ServerSide", 1)
  21. }else if (Bookmark==ClientSide){
  22.     IFBookmark = "Bookmark Found: Sending you to ClientSide.";
  23.     gotoAndPlay("ClientSide", 1)
  24. }else if (Bookmark==GraphicDesign){
  25.     IFBookmark = "Bookmark Found: Sending you to GraphicDesign.";
  26.     gotoAndPlay("GraphicDesign", 1)
  27. }else if (Bookmark==ExtensiveWebDesign){
  28.     IFBookmark = "Bookmark Found: Sending you to ExtensiveWebDesign.";
  29.     gotoAndPlay("ExtensiveWebDesign", 1)
  30. }else if (Bookmark==Presentations){
  31.     IFBookmark = "Bookmark Found: Sending you to Presentations.";
  32.     gotoAndPlay("Presentations", 1)
  33. } else {
  34.     IFBookmark = "No Bookmark Found: Welcome to my Portfolio!";
  35.     gotoAndPlay(3);
  36. }
  37. ///////////////////////////////////////
  38. }


On the second frame in the timeline I have the following code as part of the pre loader:

Code: [ Select ]
gotoAndPlay(1);


I can read in the Bookmark variable, but it's like I can't use it in that if statement. The Dynamic text box doesn't show anything and after the page loads it sends it to the next scene regardless of whats in the Bookmark variable. I have two pictures of my designer view. One of the design field and one of the timeline.

Design Field.

Timeline.

Does anyone know whats going on? I'm sure it's a simple error, but I've used that actionscript (without the preloader) in a test file and it worked fine.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • contstrictor
  • Novice
  • Novice
  • contstrictor
  • Posts: 26

Post 3+ Months Ago

Quote:
if (Bookmark==Home){

Have you defined a variable called home and for that matter the rest of the bookmarks you want to use. Because it seems to me that you're evaluating the value of Bookmark with the value of a variable called Home. If not you probably want to consider
Code: [ Select ]
if(Bookmark=="Home"){
//etc etc
}
  1. if(Bookmark=="Home"){
  2. //etc etc
  3. }

Hope that helps... :?
  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

Ahh of course..

Yea Hours is supposed to be a string. Thanks for that!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.