flash loading html

  • racingsnake
  • Born
  • Born
  • racingsnake
  • Posts: 3

Post 3+ Months Ago

right

I have a flash movie with buttons. When I hit a button i want the flash movie to play out and at the end open an htm page in its place.

I have code on each button -

on (release) {
myVar = trained.htm;
play();
}

on (release) {
myVar = aboutus.htm;
play();
}

so the movie plays and on the last frame I have-


stop();
if (myVar == aboutus.htm) {
getURL("aboutus.htm");
}
if (myVar == trained.htm) {
getURL("programmes.htm#trained.htm");
}

All pages in same directory but not working?

Can any1 help please?



:?
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1893
  • Loc: Las Vegas

Post 3+ Months Ago

the only thing I can see wrong is that your myVar may not be carrying through to the getURL call. Try adding a trace(myVar); just before the getURL call and test it in flash to see if myVar is actually getting through.
If it's not, create it as an empty string in the root timeline, then when you reference it for setting or getting, use _root.myVar
  • racingsnake
  • Born
  • Born
  • racingsnake
  • Posts: 3

Post 3+ Months Ago

HeY Mastermind
Thanks for the help.

Trace? Where would it go in this code?-

stop();

if (myVar == aboutus.htm) {

getURL("aboutus.htm");

}

if (myVar == trained.htm) {

getURL("programmes.htm#trained.htm");

}
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1893
  • Loc: Las Vegas

Post 3+ Months Ago

Actually, I just noticed you didn't wrap your strings in quotes.

Code: [ Select ]
on (release) {
myVar = "trained.htm";
play();
}

on (release) {
myVar = "aboutus.htm";
play();
}
  1. on (release) {
  2. myVar = "trained.htm";
  3. play();
  4. }
  5. on (release) {
  6. myVar = "aboutus.htm";
  7. play();
  8. }

Code: [ Select ]
stop();

if (myVar == "aboutus.htm") {

getURL("aboutus.htm");

}

if (myVar == "trained.htm") {

getURL("programmes.htm#trained.htm");

}
  1. stop();
  2. if (myVar == "aboutus.htm") {
  3. getURL("aboutus.htm");
  4. }
  5. if (myVar == "trained.htm") {
  6. getURL("programmes.htm#trained.htm");
  7. }
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

mweh ... i wonder what for is the [code]if (myVar == ....) { getURL("...");[code].
wouldn't it be more simple to set the myVar for the desired url in the onRelease and in the movie: getURL(myVar) ?
  • racingsnake
  • Born
  • Born
  • racingsnake
  • Posts: 3

Post 3+ Months Ago

it works!

cheers guys- owe u a beer

j

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 9 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.