Font Coding Problem
Hi
I am hving pb in coding
1- I need the font to be align to center.
2- I need how to code the font family e.g "Arial" etc...
// here i hve given the family font but it does not work
myFormat.size = 25;
myFormat.font = ("fontfamily", "Arial");
//end
i have put the coding below, pls do chck in help me in it.
Thnks
===========================
Attach Code
function loadGlobalSettings(globalFile) {
_root.engXML.load(_root.xmlengPath);
_root.bgInterval = setInterval(_root.swapBackgrounds, 5000);
for (var _loc2 = 0; _loc2<_root.menuArray.length; ++_loc2) {
_root.titleBox.addItem(_root.menuArray[_loc2].attributes.value,_root.menuArray[_loc2].attributes.id);
}// end of for
_root.titleBox.selectedIndex = _root.currentChapter-1;
}// End of the function
function switchFonts(fontClip) {
myFormat.size = fontClip.fontSize;
smallFont.fontText.textColor = 0;
midFont.fontText.textColor = 0;
bigFont.fontText.textColor = 0;
biggerFont.fontText.textColor = 0;
fontClip.fontText.textColor = 255;
_root.arabicText.verseText.setTextFormat(_root.myF ormat);
_root.displayText.displayContainer.translationText .setTextFormat(_root.myFormat);
}// End of the function
var engXML = new XML();
var langXML = new XML();
var currentXML = _global.globalXML;
var comboListener = new Object();
var myFormat = new TextFormat();
xmlEnglishFilePath = _global.lang;
myFormat.size = 25;
myFormat.font = ("fontfamily", "Arial");
biggerFont.fontText.textColor = 255;
smallFont.onRelease = midFont.onRelease=bigFont.onRelease=biggerFont.onR elease=function () {
switchFonts(this);
};
loadGlobalSettings(currentXML);
Adobe > ActionScript 1 and 2
Posted on: 06/01/2008 01:43:25 AM
View Complete Forum Thread with Replies
Sponsored Links:
Anyone Know Flash CS3 Embed Font's Glyphs Range With Font Class(no TextField )
I have add some font by Font class in the library
(TextFeild.embedFonts=true)
but the font's glyphs looks not enough.
when i use text String " ü ä ö ß π à â ç è é ê ë î ï ô ù û œ "
only the "Ï€" and "Å“" is can be visible.
Font.hasGlyphs also return false;
if i only create a TextField, and Click the Embed button selection glyphs range.
the text will be fine.
but i won't use TextField by drag to the stage
i heard in flex:
@font-face {
src:local("Arial");
fontFamily: myFont;
flashType: true;
unicodeRange:
U+0041-U+005A, /* [A..Z] */
U+0061-U+007A, /* a-z */
U+0030-U+0039, /* [0..9] */
U+002E-U+002E; /* [.] */
}
so what can i do in Flash CS 3?
thanks a lot
i really tried working on this.maybe i just need go back use the .....TextField.
View Replies !
View Related
Font Usage Question (Hoping For Advice And Recommendation On Chinese Font)
Hello guys,
1st of all, thank you for reading this post.
I've been assigned to develop my first flash chinese website (Translating it from the english version which is also flash) Technically using back 100% of fla files of eng ver.
Im loading text into dynamic textbox from .xml files. I understand .xml needs to set to UTF-8 etc and technically it's showing up.
On my 1st attempt, i went for _sans / _serif and paste in the text from microsoft word. I notice _sans _serif font cant use bitmap text option and the font appears really blurry.
I took my friend advice in going for Mingliu font, as he told me that anyone that can view chinese font on a pc should have Mingliu font (somehow universal)
Embedding anything is totally out of the question, as you know embeding chinese font will skyrocket the swf filesize.
So I was hoping for some advice. Objective will be get the file size as normal, font looks sharp and crisp.
Thank you all for reading again
Cheers
View Replies !
View Related
How To Separate The Bold Style Of A Font In The Flash Font List.
Hello!
Im working on a project that has font names coming from xml.
The thing is, when the font is set to Luxury Text Bold from xml, flash cant find the font and displays nothing
The font file exists with the name, but flash will only show one in the font list (Luxury Text).
On a mac it displays separate styles too.
How would I fix this?
Thanks for any help
Martin
PS. tried publishing on a mac, but there were other issues then
edit: this problem would be solved in CS4, you can select styles when opening a document which has fonts whose names dont exactly match the ones on your pc etc. You can now select alternate styles there, inability to do so in CS3 actually caused the problem in the first place.
View Replies !
View Related
Font Mapping (default Font Not Found Error)
Hey,
This ain't abig problem, but is annoying as hell.. never bothered to post anythin here before about it.. and I can't figure it out.
When I open my site, it says font not found, use default or font mapping. I duno what font isn't found.. haha I can' remember deleting any of them off my computer.
Anyways, When I go to font mapping and change it to another font, everytime I open flash it still gives me the error, no matter how many times I change it.
How can I fix it?
Ian
View Replies !
View Related
Embedding Font And Dynamic Html Text -> Font Is Gone
Hi there ,
I've been searching all over this forum and searched on Google for an answer to this question but can't find an answer that works to me.
I have some dynamic textfields and I retrieve the data from a databases. Each textfield has a handwritten font which I embed using Character Options in the Text Properties. That works fine.
The problem is, when I check the 'Render as HTML' checkbox and send simple HTML-tags to it, the html-tags still work but the handwritten font is gone! I really tried lot of things but it really doesn't work to me.
I really hope someone can help me. I really appreciate it!
Kind regards,
forcer
View Replies !
View Related
Local Font Vs Embedded Font Trouble..any Expert Help?
Hi there!
I'm loading some dynamic text to my Flash movie. We all know about the anti-aliasing problem on fonts: they look blurred and ugly.
I know the solution for this can be solved by using Pixel fonts instead, and by using some tricks (0,0 coordenates, no resizing MC comprising text, avoid even font sizes, a few parameters in Publish Settings, etc.).
However I quite don't understand the following behaviour:
If I load some dynamic text (and I don't use a pixel font, i.e. Century Book which I import to my library) when I include the range of characters in the Character dialog (on the font properties) the quality of my text decreases a lot and it becomes really ugly. If I DON'T include any character or range of characters in the Character Dialog, then the text is more readable and looks fine...Why?
I thought the anti-aliasing problem always happened to all non-pixel fonts, however it does not happen here (except when I include a range of characters to be embedded).
I see I must choose among these four things:
1- Publish settings to Low Quality so that anti-aliasing is not applied to my MC...Not a solution..text even looks worse, not to mention the rest of my MC which is full of moving curves..
2- Change the Font set (not good for my project).
3- Include the required character ranges, despite the ugly quality of text.
4- Don't include any character range...but if somebody does not have the Century Book Font on system, I won't have control about what he's actually seeing...which is not very professional..
What can I do? Any suggestion or solution? What would you do?
I also would like to know the reason of the above mentioned behaviour, does anybody know why is it like that?
Thank you very much for your time guys.
Manare
View Replies !
View Related
Flash Application Font-Face And Font-Style
This is a similar thread to one I posted earlier but this one is more detailed to explain my problem
Does anyone know how to change the programs font-face, font-size, font-style etc ... of the console? I'm referring to all of the outer workspace area, not the stage.
I found the image below at some website by google just to illustrate:
http://cis2.stvincent.edu/martincc/introwpd/flash/flashscreen.jpg
See the panels on the right side? Swatches, Character, Sound panels. On my computer, the font size for these words and for everything inside these panels are microscopic. They are so small it can't be read unless you stare at it for a while.
How do I change the font size or face for these fonts?
Now you see the top of the screen, where it says "File Edit View Insert Modify Text Control Window Help"? All of these font sizes are perfectly normal just like everything on my computer. I also use Adobe Photoshop CS 8.0 and the panel window fonts are perfect as well as everything else, so I know that it is a problem only with my Flash 5.0.
I would appreciate any help you guys can give me, as it takes me forever to work on a project, I have to stare for a while to figure out what the panel text says.
Edited: 08/01/2007 at 04:57:30 AM by reformedman
View Replies !
View Related
Font Usage Question (Chinese Font Advice)
Hello guys,
1st of all, thank you for reading this post.
I've been assigned to develop my first flash chinese website (Translating it from the english version which is also flash) Technically using back 100% of fla files of eng ver.
Im loading text into dynamic textbox from .xml files. I understand .xml needs to set to UTF-8 etc and technically it's showing up.
On my 1st attempt, i went for _sans / _serif and paste in the text from microsoft word. I notice _sans _serif font cant use bitmap text option and the font appears really blurry.
I took my friend advice in going for Mingliu font, as he told me that anyone that can view chinese font on a pc should have Mingliu font (somehow universal)
Embedding anything is totally out of the question, as you know embeding chinese font will skyrocket the swf filesize.
So I was hoping for some advice. Objective will be get the file size as normal, font looks sharp and crisp.
Thank you all for reading again
Cheers
View Replies !
View Related
Combo Box For Font Size And Font Style
Hi all
I'm creating a text formatting toolbar. So far I've create most of the buttons including bold, italic and so on.
I've attempted to create two combo box to hold the font sizes and font syles but when one works another one it doens't .
I think the problem is with _root.onEnterFrame(); but i've no idea how to solve the problem. Even though this code doesn't do exactly one I want. Because it applies the change to the entire text area instead for the selected one.
My code is bellow
Code:
this.attachMovie("ComboBox","fontStyle_cmb",this.getNextHighestDepth(),{_x:356, _y:4});
this.attachMovie("ComboBox","fontSize_cmb",this.getNextHighestDepth(),{_x:457, _y:4});
fillFontSyle();
fillFontSize()
function fillFontSyle(){
fontStyle_cmb.setDataProvider(TextField.getFontList().sort());
fontStyle_cmb.setSelectedIndex(0);
}
function fillFontSize(){
fontSizes=[5,10,12,25,46];
for (i = 0; i < fontSizes.length; i++)
fontSize_cmb.addItem(fontSizes[i]);
fontSize_cmb.setSize(40);
}
tf = new TextFormat();
_root.onEnterFrame = function() {
fontStyle_cmb.onKillFocus = function() {
selecting = false;
};
fontStyle_cmb.onSetFocus = function() {
selecting = true;
};
if (selecting) {
_root.fontLable.text = fontStyle_cmb.getValue();
tf.font = fontStyle_cmb.getValue();
textArea.sampleTextBox.setTextFormat(tf);
} else {
fontStyle_cmb.setValue(_root.fontLable.text);
}
textArea.sampleTextBox.setNewTextFormat(tf);
};
ts= new TextFormat();
_root.onEnterFrame=function() {
fontSize_cmb.onKillFocus = function() {
selecting = false;
};
fontSize_cmb.onSetFocus = function() {
selecting = true;
};
if (selecting) {
ts.size = fontSize_cmb.getValue();
textArea.sampleTextBox.setTextFormat(ts);
}
textArea.sampleTextBox.setNewTextFormat(ts);
};
I got this code from book if there is another way to do it that woul'd be great. Since this looks a bit tedious.
Thanx
View Replies !
View Related
Embed Font Symbols And Font Size
Hi all, i've been playing around with embedding fonts and have a query.
It is very important to tick the correct bold and italic boxes for your font in the library, but does the size field make any difference?
I couldn't for instance see any difference between arial 24 embeded as arial 12 and arial 12 embeded as arial 24. Does anyone have an reason to think the library text size is important?
Thanks,
James
View Replies !
View Related
Font Problem - Embedded Font Won't Work..
I've embedded a font into my library and gone in and setup the linkage to export
to ActionScript and and Export in first frame, and I've followed several tutorials for link embedding.
Yet still my font won't show up.
Is it possible that some fonts can't be embedded?
The font i'm trying to embed is a free font called Transponder AOE.
View Replies !
View Related
Need A 16pt + Pixel Font ? Also - Font Outlines?
Hi there,
firstly, im trying to include my font outlines on my dynamic text box - but when i view the file, its all squashed up, not how it is meant to be (By using the character button, and including uppercase and lowercase).
Does this mean that it cant export my font (as per the help file - some fonts cant be exported).
Also - does anyone know of a nice, clean, crisp looking free font which will work good around 16pt ?
Many thanks for your help and time,
Neil
View Replies !
View Related
Font Now Showing Up In Font Selection List?
I am working on a project that I am using the font Bernhard Modern Std in. I used the font in my Photoshop mockup and need to use it in flash. My problem is it is not showing up in my font list in flash to select it. It is a open typeface and I am not understanding why I don't see it listed in my font list in Flash8 to select it. I need to use this font because the client is expecting it to be used. How can I get it to show up in flash to use it? I am on a PC also.
View Replies !
View Related
Is A Font A Pixel/Flash Font Or Not ?
Hello all,
For all the fonts I have, how can I tell if they are Pixel/Flash fonts or not ??
I have unfortunately created my very first Flash site not realizing that not all fonts work well with Flash presentations - The current font ( Zurich ) I am using makes the text look fuzzy and faded.
I do have other options, but how can I tell if a particular font is a Pixel/Flash font ??
Thanks in advance.
Jai Vora
View Replies !
View Related
Font Help .... Adding Font To Flash
hello flashers
I have a wee problemo. I have been asked to design a menu using Univers45 font, but as you may know this is not installed in flash.... what are my best options..??
Can i import new fonts into flash..?
I have loads of menus that need to be using this font, but dont even have the font on my PC... know any good places to get hold of this..??
Thanks for any help, it is much appreciated
Z
View Replies !
View Related
Chinese Font? Which Font To Used? *confused*
Hello guys,
Pardon me if this question is really newbie like, but you prolly have expected since it's posted on "Flash Newbies" category hehe
I've been assign to develop a fully flash based website in chinese. (1st time)
So I'm really confused on which font to use, i've searched for help on several forums (ultrashock, actionscript, kirupa, etc.) but none is related to my topic.
I've followed advice from other members in copy pasting the chinese wording from microsoft word to flash (which works) and its displaying chinese words in the flash. My question is, which font should I use so that the font isn't blurry and looks crisp sharp (easier to read).
I've tried googling chinese pixel font, chinese font download etc.
Example font's i've downloaded and tried to use (http://www.sino.uni-heidelberg.de/ed...nese_fonts.htm) , i downloaded the font but it's not showing up in my flash 8. I tried using _sans & _serif , Both is okay lookin but still is blurry.
Putting it into photoshop and save it as an image and put it in flash isn't an option (I know it can be done, and prolly better). But due to how the fla is construct , i'm not allowed to do so..
For all of the above, the font is merely used on static text mode.
-------
2nd question.
A certain part of the flash site uses dynamic textbox and load .xml file into it. I understand that .xml needs to set to UTF-8 etc and it's showing up on the .swf. Also a question of which font to use for the dynamic textbox? I do not want to embed the fonts as it will increase the file size alot. So same question, how do I make it clean,sharp & crisp.
I'll be looking forward in hearing from you guys
Cheers
View Replies !
View Related
Font In Preloader Uses Substitute Font
Hi therem
Just a quick question
I have created a preloader using Microgramma font for the updating percentage value
When the preloader is displayed on a pc that doesnt have Microgramma installed it chooses a substitute font
Is ther any way to get round this???
Cheers
J
www.omega-completion.com
View Replies !
View Related
Chinese Font? Which Font To Used? *confused*
Hello guys,
I've been assign to develop a fully flash based website in chinese. (1st time)
So I'm really confused on which font to use, i've searched for help on several forums (ultrashock, flashkit, kirupa, etc.) but none is related to my topic.
I've followed advice from other members in copy pasting the chinese wording from microsoft word to flash (which works) and its displaying chinese words in the flash. My question is, which font should I use so that the font isn't blurry and looks crisp sharp (easier to read).
I've tried googling chinese pixel font, chinese font download etc.
Example font's i've downloaded and tried to use (http://www.sino.uni-heidelberg.de/e...inese_fonts.htm) , i downloaded the font but it's not showing up in my flash 8. I tried using _sans & _serif , Both is okay lookin but still is blurry.
Putting it into photoshop and save it as an image and put it in flash isn't an option (I know it can be done, and prolly better). But due to how the fla is construct , i'm not allowed to do so..
For all of the above, the font is merely used on static text mode.
-------
2nd question.
A certain part of the flash site uses dynamic textbox and load .xml file into it. I understand that .xml needs to set to UTF-8 etc and it's showing up on the .swf. Also a question of which font to use for the dynamic textbox? I do not want to embed the fonts as it will increase the file size alot. So same question, how do I make it clean,sharp & crisp.
I'll be looking forward in hearing from you guys
Cheers
View Replies !
View Related
Sharing Font Without Loading Again The Font?
Hello world :
The new problem :
Main.swf (63kbs)
…….|__myfont (in library, -60kbs-)
…….|__ textField (textStyle.font=”myfont”)
…….|__container.loadMovie(other.swf)
Other.swf (3kbs)---->>>Don’t want to put the font in library because the size
…….|__textField (textStyle.font=”myfont”//that I want to use from the main.swf )
Text in main.swf works perfectly but other.swf looks like it can’t use the font from the main.swf (also if other.swf has been loaded and initialized) so this problem was solved with sharing the font like it’s explained here: livedocs or here
So now, both of the swf files can use the font and the size in other.swf is preserved (3kbs)… but when I tested the main.swf -simulate download- looks like other.swf is loading again the font… and this is redundant cause the font is already in main.swf and wait for another 60kbs is a waist of time .
So anybody has any idea??? Of how we can use the same font in other movies already loaded in the same movie where the font is????
Thanks
View Replies !
View Related
How Do Specify Font Size And Font Style Through AS3
Hello this code works fine... but i just cant adjust the font and the font size i tried :
external_txt.fontSize = 26;
external_txt.fontStyle = verdana;
it doent work... any ideas? heres the whole code
var external_txt:TextField = new TextField();
var externalReq:URLRequest = new URLRequest("file1.txt")
var externalLoad:URLLoader = new URLLoader();
externalLoad.load(externalReq)
externalLoad.addEventListener(Event.COMPLETE, textReady);
external_txt.x = 100;
external_txt.y = 600;
external_txt.border = true;
external_txt.width = 50;
external_txt.height = 20;
addChild(external_txt);
function textReady(event:Event):void
{
external_txt.text = event.target.data;
}
View Replies !
View Related
Font Not Showing Up In Font List
I have a bunch of Frutiger fonts and for some reason only half of them are showing up in my Flash program's fonts list. For example, the one I need, Frutiger 45 Light, isn't showing when Frutiger 47 Light Condensed is. Any reason this would happen? It shows up fine in Photoshop. I'm on an iMac OSX 10.5.3.
Below is an image from my font book. The ones that aren't showing up are the ones with '*'s in them? Could this be something weird with the fonts and not Flash?
Thanks!
View Replies !
View Related
Font Question And Font Mapping
Does anyone know of a way to automatically go through a project and set all of the fonts permanently to system fonts?
I can remove all of the fonts I used from my fonts library and when I load the FLA it uses the system fonts, like it should and like I need it to. The problem I am having is when I reinstall those fonts and reload my FLA, they go back to being the font they should.
Does anyone know how to permanently map those fonts to a system font, without doing one text field at a time?
View Replies !
View Related
Duplicate Font In Font List
In my pull-down font lists in Flash 2004, Flash 8, and Flash 9 there are two entries for Arial CE. This occurred recently for reasons that I can't figure out. When I delete Arial CE from my Windows font collection, one of the entries in the Flash font list disappears, but the other remains (even after restarting Flash.)
Regardless of whether the font appears once or twice, it doesn't behave correctly. When I open a file that uses Arial CE, text fields that were created with Arial CE display that font name but show up as a serif font.
I can create a new text field that correctly uses Arial CE, but I can't fix the old ones. Even search and replace fails.
It would seem to me that the extra version is corrupt, but somehow incorporated into the Flash system rather than coming from Windows.
Any ideas?
View Replies !
View Related
Duplicate Font In Font List
In my pull-down font lists in Flash 2004, Flash 8, and Flash 9 there are two entries for Arial CE. This occurred recently for reasons that I can't figure out. When I delete Arial CE from my Windows font collection, one of the entries in the Flash font list disappears, but the other remains (even after restarting Flash.)
Regardless of whether the font appears once or twice, it doesn't behave correctly. When I open a file that uses Arial CE, text fields that were created with Arial CE display that font name but show up as a serif font.
I can create a new text field that correctly uses Arial CE, but I can't fix the old ones. Even search and replace fails.
It would seem to me that the extra version is corrupt, but somehow incorporated into the Flash system rather than coming from Windows.
I've uninstalled all versions of Flash and reinstalled Flash 8. The problem persists.
Any ideas?
View Replies !
View Related
Duplicate Font In Font List
In my pull-down font lists in Flash 2004, Flash 8, and Flash 9 there are two entries for Arial CE. This occurred recently for reasons that I can't figure out. When I delete Arial CE from my Windows font collection, one of the entries in the Flash font list disappears, but the other remains (even after restarting Flash.)
Regardless of whether the font appears once or twice, it doesn't behave correctly. When I open a file that uses Arial CE, text fields that were created with Arial CE display that font name but show up as a serif font.
I can create a new text field that correctly uses Arial CE, but I can't fix the old ones. Even search and replace fails.
It would seem to me that the extra version is corrupt, but somehow incorporated into the Flash system rather than coming from Windows.
I've uninstalled all versions of Flash and reinstalled Flash 8. The problem persists.
Any ideas?
View Replies !
View Related
How To Embed A Font From A Font Symbol
Hi everybody,
I keep having the same trouble everytime I try to use a font symbol from an external library in a dynamic textfield.
I create the font symbol in my external library, with the options "Export for Actionscript", "Export for runtime sharing" and Export in first frame" all selected. I also give it an identifier "font1"
I import the font symbol into my main movie, and create the following script for a text format to be use with a textfield.
Code:
var tabText_fmt:TextFormat = new TextFormat();
tabText_fmt.color=0x000000
tabText_fmt.font = "font1";
//
dada_txt.embedFonts = true;
dada_txt.text = "Thank You";
dada_txt.setTextFormat(tabText_fmt);
But when I publish the movie, there is no text in the textfield.
Can anyone please help me? Is there any step that I am missing?
Thanks a lot
View Replies !
View Related
(FONT) Searching For Specific Font
Hiya not sure if this is the right place to post but, ive recently bought a new pc and forgot to back up my font folder :@ which had a specific font (which under flash was known as MINI) i tryed to find it on the we but no luck, I know its a free font. Plz let me know where it can be downloaded thanks
View Replies !
View Related
Device Font Vs Pixel Font
I didn't use device fonts before but i am really satisfied with them now, they look almost good as pixel at smaller sizes(some letters r not perfect) and they r free :-). Ofcourse there is only 3 type and only _sans is really good for job :-). So i am wondering is there some special reason i should use some Miniml standard font if i can use device font _sans which is really similar (or the same) as Arial used in HTML. What is this device font anyway? why didn't MM make more of this device fonts? Anyway i am pretty satisfied with them, do you use them?
p.s.
still this font cannot be animated(put at some angles other then 0 )
View Replies !
View Related
How To Embed A Font From A Font Symbol
Hi everybody,
I keep having the same trouble everytime I try to use a font symbol from an external library in a dynamic textfield.
I create the font symbol in my external library, with the options "Export for Actionscript", "Export for runtime sharing" and Export in first frame" all selected. I also give it an identifier "font1"
I import the font symbol into my main movie, and create the following script for a text format to be use with a textfield.
var tabText_fmt:TextFormat = new TextFormat();
tabText_fmt.color=0x000000
tabText_fmt.font = "font1";
//
dada_txt.embedFonts = true;
dada_txt.text = "Thank You";
dada_txt.setTextFormat(tabText_fmt);
But when I publish the movie, there is no text in the textfield.
Can anyone please help me? Is there any step that I am missing?
Thanks a lot
View Replies !
View Related
Detecting Font And Font Size
I need to detect a font and font size for a dynamic text field.
My text field is called ElmText1
I thought this should work but it doesn't
ElmText1.size
ElmText1.font
I know I could find it out by first setting the font and size using the TextFormat (object) but want to avoid having to set the font this way.
All I want to do is detect it, not set it.
Anyone know how to do this?
Thanks
View Replies !
View Related
Coding In The MC
well it seems that I can not figure out how to open the Movie Clips in order to implement the code.
the original MC is called birthday and it has several layers in top of the static layer, where all the MC objects are distribute in layers in other to fade them in and out. however, I can not open the MC to implement the code and call through instances the objects to appear and desapear
__________________
mariusvam@hotmail.com
View Replies !
View Related
Coding...
I'm new to Flash MX- i dabbled in Flash 3 but as I now see things have progressed way to much and I'm learing the program all over... I'm trying to find out how to enter code for a frame action. Its to set up a preloading movie clip. Can anyone help? Thanks!
View Replies !
View Related
Coding
This may sound really stupid but how do you achallly put in code. Because i want to make an inventory systom , ive got the code but i dont know where to put it?
View Replies !
View Related
Coding Help
I got a sample of some code to move and object up and down , using 'K' and 'M'. All the code makes sense except the variable moveY.
I Have no Idea what it's doing , where it was declared and initialised and how it actually works.
Could someone please explain the Logic of $moveY.
onClipEvent (enterFrame) {
if (Key.isDown(75) && _y>65) {
if (movey>=0) {
moveY =-1;
}else if (moveY>-4) {
moveY*=1.2;
}
keypressed = true;
_y += moveY;
}
if (Key.isDown(77) && _y<250) {
if (movey<=0) {
moveY =1;
}else if (moveY<4) {
moveY*=1.2;
}
keypressed = true;
_y += moveY;
}
if (!keypressed) moveY = 0;
}
View Replies !
View Related
Need Some Help With My Coding...
I have some scrolling buttons that when i click on them, i want them to display a couple of pictures and also some information that describes the pictures. The information will be brought into the textfield from an external file. I have this code inserted on my button. Any help will be apperciated.
[Here's my Code]
---------------------------------------------------------------------
on (release) {
images1.play()
//Load the textfile containing all text for this website
siteData = new LoadVars();
siteData.load("text1.txt");
siteData.onLoad = function(success) {
if (success) {
textbox.text = siteData.myFirstvar;
//trace(siteData.myFirstvar);
//trace(siteData.mySecondvar);
} else {
trace("file NOT found");
}
};
}
---------------------------------------------------------------------
Thanks,
Tony
View Replies !
View Related
Help With Coding
Hi,
on my website i want to make a counter that counts down till saturday 11 pm, from saturday 11 pm till sunday 8 am i want to display "party in progress" and at 8 am the counter has to reset and count back down till saturday 11 pm.
Can somebody help me with the coding please ?
thx very much
View Replies !
View Related
How Would I Go About Coding This?
the following code doesn't work because each clip duplicates itself, along with the code, ad infinitum, causing a flash error message:
onClipEvent (load) {
this.duplicateMovieClip("script3", 1);
script3._x = this._x + this._width - 1;
}
the above was a failed test!
what i really need to do is make a script that will position a series of mcs next to each other (as in: mc._x = this._x + this._width - 1 so that each of them can then be populated using loadmovie.
also, two of the 11 mcs i am loading are different widths to all the others. how would i go about coding this?
no doubt this is easy if you actually understand actionscript!
any help would be much appreciated!
View Replies !
View Related
Swf To Swf Coding
I have a Btn that works great. It's inside a MC inside an swf. I've made a menu that has 10 empty movie clips that pulls the Btn in and everything works great. I just can't seem to coding the Btns. It's a Btn inside a MC inside a SWF being pulled into a MC inside my main time line. I'm trying to make this menu so I can change out the Btns and everything works. Here's my code:
_level0.mc1.mc.btn.onRelease = function() {
getURL("Page","_Blank");
}
I've also tried:
tellTarget (_level0.mc1.mc.btn) {
onRelease = function() {
getURL("Page","_Blank");
}
Anybody have any ideas??? Please???
View Replies !
View Related
Just Bad Coding? Please Help
Code:
_root.fromEsp =_root.config.firstChild.childNodes[i].firstChild.toString();//grabs xml data contains a path to a file
trace("location+asset= "+_root.fromEsp)//debug
var assetName = _root.fromEsp.split("\");//split array into back slashes
_root.fileName = assetName.pop();//get file name by "popping" array
pathFile="C:\test\"+_root.fileName //rebuild new path by concat...
gotoAndPlay("calc")//proceed
Hello code kings and queens Im stuck on this one and really need your help.
Im grabbing the path from xml which points to a file.
after the above code I hope to end up with
• the full original filepath "_root.fromEsp"
• the name of file "assetName"
• a rebuilt path which includes the name of file."pathFile"
My problem:
The above works well. BUT if _root.fromEsp is a
path to a movie file (wmf,avi,mpg etc) , trace (on line 2) returns the filename of my movie without the full path???
Really bugging me! if "_root.fromEsp" is a path to a jpeg or swf there is no problem.
hope this makes sense.
Thanks for your time
Cheers
View Replies !
View Related
Help With Some Coding Please
Hello, i am a "graphical guy" and new in flash.
Now i wanted to trie some effect in flash that needs a bit coding but i'm a newbie so i wanted to ask if some-one of you could be so kind to help.
this is what i'm trying to achieve:
http://www15.brinkster.com/morreke/howto.jpg [copy and paste url please]
anybody ?
thx
View Replies !
View Related
Help With Some Coding...
Ok here it goes...Im ive got a button and when that button is clicked it is to load text into a dynamic text box...every thing is set up correctly but the coding i think is wrong take a look and tell me what you think...
Quote:
on (release) {
= new loadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}
View Replies !
View Related
Help With Coding. Thanks
Can anyone teach me or share the coding like the one in the website below? i mean the pictures which can see 360% degree
http://www.sydneyoperahouse.com/sect...ur/vrtour2.asp
Thanks... i need that in my project..
View Replies !
View Related
Help With Coding
hei,
just got help from you guys - but i don´t manage to get it right.... (---see attached file)
(the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square)
can anyone tell me what i am doing wrong?
taking what you already have, do the following:
1. Inside your movie clip, turn the red box into a movie clip instance and then name it "redSquare" in your properties box.
2. Remove your current functions (all but the stop()) from your first frame of your fading movie clip timeline.
3. Give your fading movie clip placed on _root the name greyBox
4. Assign the following actions to the "redSquare" mc inside the "greyBox" mc:
code:
onClipEvent(enterFrame){
this.onEnterFrame = function(){
if(rewind == true){
_root.greyBox.prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
_root.greyBox.play();
}
this.onRollOut = function(){
rewind = true;
}
this.onRelease = function(){
_root.gotoAndPlay(34);
}
}
This should work for you. It did for me.
View Replies !
View Related
Help Coding
PHP Code:
//--------------------------------------------------------------------------
// location of the playlist if no html parameter is found
// change "playlist.xml" if you want another filename ..
//--------------------------------------------------------------------------
_root.playlist == undefined ? playlist = "mp3player.xml" : playlist=_root.playlist;
//--------------------------------------------------------------------------
// below here it's all code and code ..
//--------------------------------------------------------------------------
// stage variables
Stage.showMenu = false;
Stage.scaleMode = "noScale";
stop();
// player variables
volume = 90;
current_song = 1;
top.equalizer._visible=0;
// playlist loading
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = loadData;
data_xml.load(playlist);
// parsing all xml data into flash
function loadData(success) {
if (success) {
// showdisplay and playlist toggles
showDisplay = this.firstChild.attributes.showDisplay;
if (showDisplay == "yes") {
top.easeY(toppos);
topup = false;
display_btn._rotation+=180; }
showPlaylist = this.firstChild.attributes.showPlaylist;
if (showPlaylist == "yes") {
bot.easeY(botpos);
botup = false;
list_btn._rotation+=180; }
// getting all titles and filenames
aPath = new Array();
songTitel = new Array();
audioTracks = new Array();
audioTracks.shuffle();
audioTracks = this.firstChild.childNodes;
song_total = audioTracks.length;
for (var i = 0; i<song_total; i++) {
aPath.push(audioTracks[i].attributes.path);
songTitel.push(audioTracks[i].attributes.title);
// buiding playlist buttons
bot.playlist.btn.duplicateMovieClip("btn"+i, i);
bot.playlist["btn"+i]._y = bot.playlist.btn._y+i*int(bot.playlist.btn._height) +i;
bot.playlist["btn"+i].txt = checkDigits(i+1)+". "+songTitel[i];
bot.playlist["btn"+i].hit.onPress = function() {
listClick(this._parent.getDepth()+1); };
}
//checking autostart mode
autoStart = this.firstChild.attributes.autoStart;
if (autoStart == "yes") {
playSong();
play_btn._visible = 0;
} else if (autoStart == "no") {
play_btn._visible = 1;
pause_btn._visible = 0;
} else if (autoStart == "random") {
current_song = random(song_total)+1;
playSong();
play_btn._visible = 0;
} else {
current_song = int(this.firstChild.attributes.autoStart);
playSong();
play_btn._visible = 0; } }
// done ! all loaded succesfully. purging trash
delete audioTracks;
delete data_xml;}
// list button
function listClick(prm) {
delete pausepos;
current_song = prm;
MySound.stop();
playSong(); }
// list scroller
bot.list_bg.onEnterFrame = function() {
if (hitTest( _root._xmouse, _root._ymouse, true) && this._parent.playlist._height > this._height ) {
ymin = this._y+this._height - this._parent.playlist._height;
ymax = this._y+3;
conv = (this._ymouse -15)*1.3/this._height;
conv > 1 ? conv = 1 : null;
conv < 0 ? conv = 0 : null;
this._parent.playlist.easeY (ymax - conv*(ymax-ymin)); } };
bot.playlist.setMask(bot.list_bg);
// play function
function playSong() {
AudioPath = aPath[current_song-1];
// checking for pause > start from there
if (pausePos>0) {
top.equalizer._visible = 1;
MySound.start(pausePos, 0);
pausePos = 0;
// startup new sound
} else {
MySound = new Sound();
MySound.setVolume(volume);
MySound.loadSound(AudioPath, true);
MySound.onSoundComplete = function() {
top.equalizer._visible = 0;
if (autoStart == "random") {
current_song = random(song_total)+1;
} else {
current_song == song_total ? current_song = 1 : current_song++;
}
playSong(); };
// check loading bar
top.track_load.onEnterFrame = function() {
total = this._parent._parent.MySound.getBytesTotal();
geladen = this._parent._parent.MySound.getBytesLoaded();
if (geladen != total) {
this._parent.load_display = Math.round((geladen*100/total))+"% Loaded";
this._xscale = Math.round((geladen*100/total));
} else {
this._xscale = 100;
top.equalizer._visible = 1;
delete this.onEnterFrame;
delete this._parent.load_display; } }; }
// switch paly/pause buttons
play_btn._visible = 0;
pause_btn._visible = 1; }
// play button
play_btn.onRelease = function() {
playSong(); };
// pause button
pause_btn.onRelease = function() {
this._visible = 0;
play_btn._visible = 1;
pausePos = MySound.position/1000;
MySound.stop();
top.equalizer._visible=0; };
// next button
next_btn.onRelease = function() {
delete pausepos;
current_song == song_total ? current_song = 1: current_song++;
MySound.stop();
playSong(); };
// previous button
prev_btn.onRelease = function() {
delete pausepos;
current_song == 1 ? current_song = song_total: current_song--;
MySound.stop();
playSong(); };
// display toggle button
top.setMask(top_mask);
toppos = top._y;
top._y = int(toppos + top_mask._height - 29);
topup = true;
display_btn.onPress = function() {
if(topup == true) {
top.easeY(toppos);
topup = false; }
else {
top.easeY(int(toppos + top_mask._height -27));
topup = true; }
this._rotation += 180; };
// playlist toggle button
bot.setMask(bot_mask);
botpos = bot._y;
bot._y = botpos - bot.list_bg._height -6;
botup = true;
list_btn.onPress = function() {
if(botup == true) {
bot.easeY(botpos);
botup = false; }
else {
bot.easeY(botpos - bot.list_bg._height -6);
botup = true; }
this._rotation += 180; };
// drag button functionality
drag_btn.onPress = function() {
startDrag(this._parent); };
drag_btn.onRelease = drag_btn.onReleaseOutside=function () {
stopDrag(); };
// copyright button
copy.onPress = function() {
getURL("http://www.jeroenwijering.com/?item=Flash+Mp3+Player","_blank"); }
// updating time display
this.onEnterFrame = function() {
dur = int(MySound.duration/1000);
pos = int(MySound.position/1000);
playTime = {};
playTime.minutes = int((pos)/60);
playTime.seconds = int((pos)%60);
playTime.total = checkDigits(playTime.minutes)+":"+checkDigits(playTime.seconds);
trackTime = {};
trackTime.minutes = int(dur/60);
trackTime.seconds = int(dur%60);
trackTime.total = checkDigits(trackTime.minutes)+":"+checkDigits(trackTime.seconds);
if (top.load_display == undefined) {
top.display = playTime.total+" / "+trackTime.total;
} else {
top.display = top.load_display; }
if (top.trackDrag != true) {
prozent = pos*100/dur;
top.track_play._xscale = prozent; } };
// prefixing a 0 to the time
function checkDigits(toCheck) {
return (toCheck<10) ? toCheck="0"+toCheck : toCheck; }
// track progress slider functions
top.track_back.onPress = function() {
this._parent.trackDrag = true;
this._parent.track_play.onEnterFrame = function() {
perc = (this._parent._xmouse-this._parent.track_back._x)/this._parent.track_back._width;
max = this._parent.track_load._width/this._parent.track_back._width;
perc > max ? perc = max: null;
perc < 0.01 ? perc = 0.01: null;
this._width = this._parent.track_back._width*perc;
this._parent._parent.pausePos = (perc*this._parent._parent.MySound.duration/1000); }; };
top.track_back.onRelease = top.track_back.onReleaseOutside = function () {
delete this._parent.track_play.onEnterFrame;
this._parent.trackDrag = false;
MySound.stop();
playSong(); };
// volume slider functions
vol_back.onPress = function() {
vol_front.onEnterFrame = function() {
perc = (_xmouse-vol_back._x)/vol_back._width;
perc > 0.95 ? perc = 1: null;
perc < 0.05 ? perc = 0: null;
this._width = vol_back._width*perc;
volume = Math.round(perc*100);
MySound.setVolume(volume);
top.equalizer._yscale = volume; }; };
vol_back.onRelease = vol_back.onReleaseOutside=function () {
delete vol_front.onEnterFrame; };
vol_front.setMask(vol_mask);
// drawing equalizer in actionscript
top.equalizer.setMask(top.eq_mask);
top.equalizer.onEnterFrame = function() {
i++;
this.createEmptyMovieClip("graph"+i, i);
with(this["graph"+i]) {
_x = 0;
_y = 0;
beginFill(0x666666, 50);
moveTo(0,0);
for (j=0; j< 36; j++) {
z = random(12)+8;
lineTo(j*6,-1);
lineTo(j*6,-z);
lineTo(j*6+4,-z);
lineTo(j*6+4,-1);
lineTo(j*6,-1); }
lineTo(j*6,0);
lineTo(0,0);
endFill(); }
i >= 3 ? i=0: null; };
// scrolling the display song title
function scrollTitle() {
top.title.txt.autoSize = true;
if (songTitel[current_song-1].length > 20) {
top.title.txt.text = songTitel[current_song-1]+" "+songTitel[current_song-1];
top.title._x+top.title._width/2 +4< top.title_mask._x ? top.title._x = top.title_mask._x : top.title._x--; }
else {
top.title.txt.text = songTitel[current_song-1];
top.title._x = top.title_mask._x-3; } }
top.title.setMask(top.title_mask);
setInterval(scrollTitle, 40);
// easing display and playlist movement
MovieClip.prototype.easeY = function(t) {
this.onEnterFrame = function() {
this._y = int(t-(t-this._y)/1.5);
if (this._y>t-1 && this._y<t+1) {
delete this.onEnterFrame; } }; };
That's a code from my .fla file. How would i make it so that instead of the variables showing in the .xml file, they are defined in the [html]<object></object>[/html] code? i understand that this will make the variables visible in view source and i am fine with that.....
View Replies !
View Related
|