-
The Simple things escape me :(
I know there must be a simple answer... but I have an swf with banners in it... the user clicks on a banner and a text box shows the code that u can cut and past to show the banner in ur webpage etc...
this is what i have for the AS...
Code:
b1.onPress = function(){
myText.text = "<a href='http://www.elinorgeller.com'><img src='http://www.vibetribe.org/elinorgeller/images/links/banner01.jpg' alt='Elinor Geller The Spirit Child' width='468' height='60' border='0' /></a>";
}
however... > ' < doesnt work on myspace... only > " <
is there a way i can type the folling in AS without confusing a text string with in a text string... can > " < be used also as just a text string?
obviously like this doesnt work >>>
Code:
b1.onPress = function(){
myText.text = "<a href="http://www.elinorgeller.com"><img src="http://www.vibetribe.org/elinorgeller/images/links/banner01.jpg" alt="Elinor Geller The Spirit Child" width="468" height="60" border="0" /></a>";
}
thanks in advance
-
Senior Member
You need to escape the quotation marks with a backslash, try:
Code:
b1.onPress = function(){
myText.text = "<a href=\"http://www.elinorgeller.com\"><img src=\"http://www.vibetribe.org/elinorgeller/images/links/banner01.jpg\" alt=\"Elinor Geller The Spirit Child\" width=\"468\" height=\"60\" border=\"0\" /></a>";
}
The backslashes will not be displayed in your textbox.
Regards
Last edited by ninjakannon; 02-15-2007 at 12:49 PM.
-
Senior Member
don't worry its not your fault.......myspace doesn't allow links made in flash but it does allow css and html links the trick is to make your links using css and html so that they just appear to be part of the flash stage....but the css and html links cannot be part of the .swf ! the links must be outside the .swf
-
solved it.!!!!
Code:
var quote= '"'
b1.onPress = function(){
myText.text = "<a href="+quote+"http://www.elinorgeller.com"+quote+"><img src="+quote+"http://www.vibetribe.org/elinorgeller/images/links/banner01.jpg"+quote+" alt="+quote+"Elinor Geller The Spirit Child"+quote+" width="+quote+"468"+quote+" height="+quote+"60"+quote+" border="+quote+"0"+quote+" /></a>";
}
yippy
-
Senior Member
Originally Posted by Avigeller
Code:
var quote= '"'
b1.onPress = function(){
myText.text = "<a href="+quote+"http://www.elinorgeller.com"+quote+"><img src="+quote+"http://www.vibetribe.org/elinorgeller/images/links/banner01.jpg"+quote+" alt="+quote+"Elinor Geller The Spirit Child"+quote+" width="+quote+"468"+quote+" height="+quote+"60"+quote+" border="+quote+"0"+quote+" /></a>";
}
That would work, however I've given an even simpler solution - read above ^^ :P
EDIT: Oh, actually your function wouldn't work, Avigeller. You need to either change your quote variable to '_root.quote' and reference it that way or put 'var quote = '"';' inside the b1.onPress function.
Last edited by ninjakannon; 02-15-2007 at 12:58 PM.
-
its been working fine for me.... i use var quote = ' " ' (note the single quotes)
-
Senior Member
Originally Posted by Avigeller
its been working fine for me.... i use var quote = ' " ' (note the single quotes)
Yeah, I know it's in single quotes.
For functions stated like 'myFunction = function () {' you definitely have to put the 'var quote = '"';' inside the function, apparently not for 'object.functionType' functions.
Anyway, I still recommend escaping the quotes with backslashes - it's the best method of doing this.
-
Senior Member
allright this post is great news !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|