Flashblocks Flash CMS
Welcome, Guest
Please Login or Register.    Lost Password?
Re:altering attributes for links in the html edito (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Re:altering attributes for links in the html edito
#4522
yogananda ()
User Offline Click here to see the profile of this user

 
altering attributes for links in the html editor 8 Months, 1 Week ago
Hi Sunny

I really enjoy working with FlashBlocks. I just started a week ago and it's so intuitivly easy, with a little noodling things just work out.

A question to how the links are displayed in the html-editor.

in the flashblocks_FlashTextHtml.xml file I changed the line (37):




to fit my layout design, but can I make it change color when the mouse cursor rolls over (hover)
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4527
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 8 Months, 1 Week ago
You can achieve this with CSS.
Code: :

  a:link {color#FF0000;} a:hover{color#00FF00;}


The Flash help files cover this topic in detail.

The following code may be useful as well if you need to know when a text field has been updated by Flashblocks. "complete" is dispatched from each Editblock instance when it is populated with content.
Code: :

  var ebListen:Object = {}; ebListen.complete = function(obj:Object){    //    {type, target, tagData}     //    Editblock instance     //    obj.target          //    movie clip that is attached to Editblock:     //    obj.target.targetMC          //    trace the entire data object with TraceObject     //    flashblocks.Flashblocks.TraceObject(obj.data) } myEditblock.addEventListener("complete"ebListen);

 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/01 21:18 By admin.
  The administrator has disabled public write access.
#4534
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 8 Months, 1 Week ago
If you would like to add rollover CSS to the smooth scroller 2 module, open the movie clip, "Smooth Scroller2" and add CSS definitions to to the beginning of the displayHtml function so that it looks something like this:
Code: :

 function displayHtml (str,styles) {     var mc msk.content          var cssStr "a:link {color: #0099FF;} a:hover{color: #006BB3;}";     var styles = new TextField.StyleSheet();     if (!styles.parseCSS(cssStr)) trace("CSS Error");     mc.createTextField("txt"300widthheight);     mc.txt.antiAliasType "advanced"     mc.txt.autoSize true;     mc.txt.multiline true;     mc.txt.wordWrap true;     mc.txt.embedFonts true;     mc.txt.selectable true;     mc.txt.html true     mc.txt.styleSheet styles;     mc.txt.htmlText str     // fix autoSize Flash Bug     mc.txt.height mc.txt._height     mc.txt.autoSize false }

 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/03 02:45 By admin.
  The administrator has disabled public write access.
#4535
yogananda ()
User Offline Click here to see the profile of this user

 
Re:altering attributes for links in the html edito 8 Months, 1 Week ago
That did the trick, thanks a million !!!!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4536
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 8 Months, 1 Week ago
Update: There is a bug in Flash when autoSize is true. I have updated the code above with a work around to fix this.
Code: :

 // fix autoSize Flash Bug mc.txt.height mc.txt._height mc.txt.autoSize false

 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4620
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 7 Months, 4 Weeks ago
Another option is to set the Editblock.OnComplete function that is called for every Editblock instance:
Code: :

 flashblocks.Editblock.OnComplete = function (obj) {     var cssStr "a:link {color: #FF0000;} a:hover{color: #00FF00;}";     var styles = new TextField.StyleSheet();     if (!styles.parseCSS(cssStr)) trace("CSS Error");     else if (obj.target.targetMC.htmlobj.target.targetMC.styleSheet styles }

 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/14 03:36 By admin.
  The administrator has disabled public write access.
#5110
yogananda ()
User Offline Click here to see the profile of this user

 
Re:altering attributes for links in the html edito 5 Months, 2 Weeks ago
Is it possible to define a totally different LINK style to just one smooth scroller 2 module.

So not only changing the color when hovering over, but changing the font and size of the text displayed as a link.

I don't want to alter the flashblocks_FlashTextHtml.xml because it's only on one page I need the links to look different...
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5112
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 5 Months, 2 Weeks ago
See above:
It may simplest for you to duplicate the smooth scroller module move clip and make the changes.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5123
yogananda ()
User Offline Click here to see the profile of this user

 
Re:altering attributes for links in the html edito 5 Months, 2 Weeks ago
This is also what I thought, but I need some help with the code:
font, size

and does it go in with
Code: :

 var cssStr "a:link {color: #FF0000;} a:hover{color: #00FF00;}";



sorry about the simple question but coding is not my strong side
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5126
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:altering attributes for links in the html edito 5 Months, 2 Weeks ago
It would be best to follow a tutorial on the subject. Here is one. http://www.actionscript.org/resources.../55/1/CSS-in-Flash-MX-2004/Page1.html
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop

Thank you