So I have had an idea in my my head for quite some time now but due to my limited flash knowledge haven't been able to figure any of it out.
The idea goes as such; I want to be able to set divs inside of a web page using html and have them named either with classes or id's but instead of using css to customize it I would like to set the boxes up in a flash document with certain boxes pointing to certain divs. Is this possible or way to complex?
Flash and css
Page 1 of 12 Replies - 787 Views - Last Post: 09 March 2010 - 03:19 PM
Replies To: Flash and css
#2
Re: Flash and css
Posted 09 March 2010 - 03:24 AM
Um... The real problem is your description, I think - at least I can't really see what are you actually trying to do...?
Wait... Do you want to use divs' IDs to make them customized / stylized from within a Flash object?
If so, you actually need to use CSS - but dynamic... To achieve this - you need Javascript. The Flash will call for a Javascript function, which will change the CSS code of that div...
Example
flash.swf - the object that will be embedded on your site
AS3 code
AS2 code
site.html
Javascript code
HTML code
(any code, with some divs with ID attribute set.)
I hope I did understand your problem... And I hope you understood my solution.
Wait... Do you want to use divs' IDs to make them customized / stylized from within a Flash object?
If so, you actually need to use CSS - but dynamic... To achieve this - you need Javascript. The Flash will call for a Javascript function, which will change the CSS code of that div...
Example
flash.swf - the object that will be embedded on your site
AS3 code
import flash.external.ExternalInterface;
ExternalInterface.call("changeCSS(" + divToChange + ", " + CSScode + ")"); //' note the "divToChange" - replace with the actual div ID, and "CSScode" should be the desired code
AS2 code
getURL("javascript: changeCSS(" + divToChange + ", " + CSScode + ")"); //' again, change the "divToChange" and "CSScode"
site.html
Javascript code
function changeCSS(divID, divCSS){
var cDiv = document.getElementByID(divID);
cDiv.cssText = divCSS;
}
HTML code
(any code, with some divs with ID attribute set.)
I hope I did understand your problem... And I hope you understood my solution.
#3
Re: Flash and css
Posted 09 March 2010 - 03:19 PM
Yes, Thats basically the idea behind my idea. I frequently visit this site where you can customize your profile with css and make it look nifty, As an idea i wanted to use more than just the Graphic option, I wanted to make something cool in flash and have it remain a .swf instead of exporting to .gif or .png. I'll try this solution out Thanks
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote



|