2 Replies - 1054 Views - Last Post: 09 March 2010 - 03:19 PM

#1 mrnumbers  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 26-February 10

Flash and css

Posted 08 March 2010 - 06:01 PM

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?

Is This A Good Question/Topic? 0
  • +

Replies To: Flash and css

#2 Aurel300  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 230
  • Joined: 10-November 07

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
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. :)
Was This Post Helpful? 0
  • +
  • -

#3 mrnumbers  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 26-February 10

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 :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1