| Author |
Message |
|
| blue |
Posted: Tue May 29, 2007 10:49 am |
|
|
|
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!  |
_________________ *** blue
She is not here anymore but doing fine at other forums with same name. Good Bye. |
|
| Back to top |
|
| Jonas M. Rogne |
Posted: Sun Aug 19, 2007 2:41 pm |
|
|
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 |
|
| Back to top |
|
| Jonas M. Rogne |
Posted: Tue Aug 21, 2007 5:14 pm |
|
|
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
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 |
|
| Back to top |
|
| Jonas M. Rogne |
Posted: Thu Aug 23, 2007 1:56 pm |
|
|
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 |
|
| Back to top |
|
| Jonas M. Rogne |
Posted: Mon Aug 27, 2007 7:27 pm |
|
|
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 |
|
| Back to top |
|
|
|