This is a discussion on "Actionscript linking to HTML parameters, can it be done?" within the Flash & Multimedia Forum section. This forum, and the thread "Actionscript linking to HTML parameters, can it be done? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Actionscript linking to HTML parameters, can it be done?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Actionscript linking to HTML parameters, can it be done?
Hello everyone, I have a question, but have no idea on how to do this. I have a swf file that I want to upload on to a site, but I want this file on every page of the site, however I dont want to upload dozens of swf files. The problem is each of these flash files will play the same animation, just with different content. Is there anyway for me to use only 1 swf file and have it link to a parameter I set in HTML? If there is anyways this can be done or another route I can take for the same result, please tell me. Thanks in advanced for the help.
|
|
|
|
#2
|
|||
|
|||
|
You can pass vars to Flash from HTML quite easily.
Both of those are necessary and need to contain the same information due to the fact that some browsers access the Flash information through the params and others use the embed tag. All of the flashvars data will be available in your flash file:
Flash uses the files like this: &var=data. So if you wanted a var called 'name' and your name was 'mark' you'd do: &name=mark You can (I believe) have as many variables as you want. You access them directly in Flash as if they were an internal variable, but I believe they are only available on the main stage and not in movieclips, etc. Hope this helps! |
|
#3
|
|||
|
|||
|
Thank you very much, this was quite confusing at first, but after looking over it a few dozen times, I understand it and have gotten the hang of it, however I still have a problem because I do not know the functions/code for placing/changing images within the HTML code (I forgot the actionscript also, but I have the code somewhere...). Do I use
<param name="Flashvars" value="&title=" "> (with quotes)or <param name="Flashvars" value="&title= > (without quotes)Thanks a lot again. PS. After further investigating, I found out that I do not know how to load it from flash either |
|
#4
|
|||
|
|||
|
You don't need to use quotes.
And as for loading using a variable, you need: _root['varname'] |
|
#5
|
|||
|
|||
|
Quote:
_root['varname'], when I try to place this inside the loadmovie code, I get an error. What I did was loadMovie(_root['image'],"bg"); I do not know what I am supposed to do... T.T thank you again for the help. |
|
#6
|
|||
|
|||
|
I see no reason why that's shouldn't work.
Use trace to display the variable on the screen to be sure it is right. |
|
#7
|
|||
|
|||
|
I placed the code (loadMovie(_root['image'],"bg")
|
|
#8
|
||||
|
||||
|
what value do you have for 'image' ? is it just the image file name, or is it (as in one of your previous posts) the full html code to display image? it shud just be the filename & path...
|
|
#9
|
|||
|
|||
|
Quote:
If I just place the filename and path, doesnt that mean I wont be able to declare the variable in html and have to resort to using many swf files? Thanks. |
|
#10
|
||||
|
||||
|
you are trying to load this image into a movieclip inside your movie, right? in that case, you should not include the <img> tags when you declare in your flashvars which image you wish to load... it shud just be
|
|
#11
|
|||
|
|||
|
Quote:
EDIT: Never mind, I still get the error in my FLA file, but when I run the swf through my browser, it is working! Weird, but if its working, I'm happy! Thank you benbarcadi and Sirkent for your great help. |
|
#12
|
|||
|
|||
|
Glad to help 8)
|
|
#13
|
||||
|
||||
|
No problem! (unusual for me to be able to help with anything to do with Flash tho!)
|
![]() |
| Tags |
| actionscript, linking, html, parameters, done |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linking to an html page | rusty149 | Web Page Design | 1 | Feb 4th, 2008 10:34 |
| movement parameters..... ARGH | callumazoo | Flash & Multimedia Forum | 6 | May 31st, 2007 14:19 |
| Function parameters that include quotes | loorp | JavaScript Forum | 7 | Sep 17th, 2006 04:18 |
| Linking pics with actionscript | kevinrhart | Flash & Multimedia Forum | 7 | Dec 31st, 2005 14:40 |
| jump to marker using parameters | Smokie | Flash & Multimedia Forum | 5 | Jan 14th, 2005 08:39 |