MA Forum Forum Index
Author Message

<  TUTORIALS & HELP  ~  Flash things

blue
Posted: Tue May 29, 2007 10:49 am Reply with quote
Moderator Joined: 27 May 2007 Posts: 109
We can discuss Flash things here.

Me(blue:Akiko) is good at ActionScripting and general Flash things. I can help you solve your problem if you have one. Please feel free to post whatever you think.

I think we have more other people who are good at Flash.

Have fun! Very Happy

_________________
*** blue

She is not here anymore but doing fine at other forums with same name. Good Bye.
View user's profile Send private message
Jonas M. Rogne
Posted: Sun Aug 19, 2007 2:41 pm Reply with quote
Moderator Joined: 27 May 2007 Posts: 176 Location: Norway
Akiko-san, Akiko-san!

I'm making a flash menu for a html page. There are 5 sub-pages. I want the current page to be highlighted in some way in my flash file.
I don't want to make 6 separate flash menus. Is there any way for the flash file to figure out on what page it is at the moment?

Maybe by putting a parameter/variable in the <object> tag on the html page to be sent to the flash file? Is that possible?

先生をお待ちする

_________________

www.rognemedia.no - Grafisk design / Graphic design
http://chain.deviantart.com
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jonas M. Rogne
Posted: Tue Aug 21, 2007 5:14 pm Reply with quote
Moderator Joined: 27 May 2007 Posts: 176 Location: Norway
I will need to pass two parameters/variables into the flash file. All files are in the same folder.
This is for a web-based menu on the DVD with my project files Wink

1. Page name or an id-number (to display menu buttons in the correct states)
2. An optional switch so that it will show the menu opening animation only on the front page.

On a side note I figured out how to load an external bitmaps into the flash file, go me!

_________________

www.rognemedia.no - Grafisk design / Graphic design
http://chain.deviantart.com
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jonas M. Rogne
Posted: Thu Aug 23, 2007 1:56 pm Reply with quote
Moderator Joined: 27 May 2007 Posts: 176 Location: Norway
Another question: When I click a button i want to delay it for a second before it goes to the specified URL (so the user has time to see my lovely graphic).

Solution (probably not the best one, but it works):
Code:
on(release){
   var clickTime = getTimer()+1000;

   while (clickTime>getTimer()) {
      //trace ("waiting");
   }
   
   //trace("1 sec elapsed");
   getURL(index.html);   
   
}


Note that the button "sticks" in the hit state until on(release) is done playing.

Thanks Akiko.

_________________

www.rognemedia.no - Grafisk design / Graphic design
http://chain.deviantart.com
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jonas M. Rogne
Posted: Mon Aug 27, 2007 7:27 pm Reply with quote
Moderator Joined: 27 May 2007 Posts: 176 Location: Norway
Solution to my original question:

In the HTML, when adding the flash file add ?variable=value at the end of the filename. Do this in the "File" field when the flash file is selected in Dreamweaver, or edit the code directly:
Code:

<param name="movie" value="menu.swf?myPage=1" />
<embed src="menu.swf?myPage=1" ...

In this example I create a variable called myPage with the value 1. I have different numbers for the different pages, allowing my menu to know what page it is on. You can use text instead of numbers if you want.

Make sure it's added both in the param and embed tags to ensure it works in all browsers (that's why we need both in the first place).

Now, in the flash file, when launched from that html file, there is a new variable (myPage) with the value 1.

Here's some code you can add to the first frame in your flash document to test if it works:
Code:
this.createTextField("myTxt", 100, 0, 0, 100, 20);
myTxt.autoSize = "left";
myTxt.text = myPage;

This will write the value of the variable with black text in the upper left corner. If there is no variable passed from the html file (e.g. if you play the flash file in the flash player) it will just say "undefined".

_________________

www.rognemedia.no - Grafisk design / Graphic design
http://chain.deviantart.com
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

Display posts from previous:  

All times are GMT
Page 1 of 1
Post new topic

Jump to:  

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 vote in polls in this forum
Protected by Anti-Spam ACP