Text Field Tab Order Oddity
I have a movie with several buttons and a couple of text fields on it. Everything is added dynamically and populated by xml. I am trying to make this product as accessible as I can, but when I add a tab order, it does not recognise the text fields at all. It just cycles through the movieclips. Even if I remove everything except the text fields it still does not tab through them.I don't know if this applies to any other versions of flash, as I am currently stuck on Flash MX 2004 (not even the professional version).Any suggestions?
Adobe > Flash General Discussion
Posted on: 10/03/2007 01:54:40 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.
I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.
I have tried this:
_root.video_title.text = _root.MC_Control.tab_title.text;
and this:
_root.video_title.text == _root.MC_Control.tab_title.text;
neither one seems work....am I missing something?
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}
Key Press Oddity
I'm writting an action that happenes on the Key down event of the arrow keys. Now heres the oddity, When I test the movie, Yeah! No Probs. I then put the movie into another web page and view it through my web server, and low and behold, nothing from the arrow keys? I get almost all the other key events.
Any ideas?
SetInterval Oddity
whan I use this code to make mc fade out, I got alpha value change in about 1.27 every step instead of 1.
code: function change_alpha()
{
mc._alpha --
trace(mc._alpha)
}
setInterval(change_alpha,50)
mc fades allright but what with the decimal fraction?
Fish
Movieclip Oddity
So I have a movieclip in the Library with the AS identifier "holder_mc", and in its first frame is a function called tester().
In the main timeline, I instantiate holder_mc as "holder1" in level 1, and call the function:
this.holder1.tester();
And nothing happens. I trace it-
trace(holder1.tester);
-and it returns "undefined". But if I first declare tester() in the main timeline and assign it into holder1, like so-
holder1.tester = tester;
holder1.tester();
-well, that works. What's going on? Any ideas?
OnRelease Oddity.
I'm having problems with an onRelease function seemingly being called twice.
Even more confusingly, the _root.slidetime 1000000 value acts as a pause - but trace value is returned as 'Play' and then 'Paused' although the pause affect works - but the un-pause effect I'm after is not happening.
Can someone see why this may be happening (snippet of larger code attached)?
PHP Code:
pause_button.onRelease = function() {
trace ("Root Time = " + _root.time);
if (slideshowpause == false){
slideshowpause = true;
_root.slidetime = _root.time;
trace ("Play");
}
if (slideshowpause == true){
slideshowpause = false;
_root.slidetime = 1000000;
trace ("Paused");
}
};
As a note, the slideshowpause value is set to false when the movie loads, and the following code on a seperate frame does all the work:
PHP Code:
for(var i=1; i<=numImages; i++){
if(i == _root.currentImage){
if(_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage].getBytesLoaded() >= _root.images_mc_container.images_mc["image_dropzone" + _root.currentImage].getBytesTotal()){
_root.imagesCached = true;
if(_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._height > (_root.movie_height - 20)){
var percent = 100 * ((_root.movie_height - 20) / _root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._height);
_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._yscale = percent;
}
if(_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._width > (_root.movie_width - 20)){
var percent = 100 * ((_root.movie_width - 20) / _root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._width);
}
if(_root.imageShown == 0 && _root.currentImage != _root.oldImage){
_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._visible = true;
_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._alpha = 0;
_root.imageShown = 1;
} else {
if(_root.currentImage != _root.oldImage && _root.fade > 0){
_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._alpha = 100 * (_root.counter / (_root.fade * _root.second));
} else {
_root.images_mc_container.images_mc["image_dropzone" + _root.currentImage]._alpha = 100;
}
_root["tag" + _root.currentImage] = xmlData.slideshow[1].images[i-1].image[1].caption.value;
}
} else {
_root.images_mc_container.images_mc["image_dropzone" + i]._visible = false;
}
} else if(i == _root.oldImage && _root.fade > 0){
_root.images_mc_container.images_mc["image_dropzone" + _root.oldImage]._alpha = 100 - (100 * (_root.counter / (_root.fade * _root.second)));
} else {
_root.images_mc_container.images_mc["image_dropzone" + i]._visible = false;
}
tag = _root["tag" + _root.currentImage];
picture_tag(tag)
}
_root.counter++;
_root.counterLimit = ((_root.slidetime + _root.fade) * _root.second);
function nextImage(){
if(_root.counter > _root.counterLimit){
_root.counter = 0;
_root.oldImage = _root.currentImage;
_root.currentImage++;
if(_root.currentImage > numImages){
if(_root.repeat == "true"){
trace ("Repeat Slideshow");
_root.currentImage = 1;
} else {
_root.currentImage = _root.numImages;
}
}
_root.imageShown = 0;
images_mc_container.play();
}
}
function prevImage(){
if(_root.counter > ((_root.slidetime + _root.fade) * _root.second)){
_root.counter = 0;
_root.oldImage = _root.currentImage;
_root.currentImage--;
if(_root.currentImage < 1){
if(_root.repeat == "true"){
trace ("Repeat Slideshow");
_root.currentImage = _root.numImages;
} else {
_root.currentImage = _root.numImages;
}
}
_root.imageShown = 0;
images_mc_container.play();
}
}
function picture_tag(tag) {
_root.caption_mc.createTextField("tag_text", 1, 24, 282, 270, 100);
tag_format = new TextFormat();
tag_format.color = 0xffffff;
tag_format.font = "Arial";
tag_format.size = 18;
_root.caption_mc.tag_text.embedFonts = true;
_root.caption_mc.tag_text.multiline = true;
_root.caption_mc.tag_text.wordWrap = true;
_root.caption_mc.tag_text.autoSize = true;
_root.caption_mc.tag_text.html = true;
_root.caption_mc.tag_text.selectable = false;
_root.caption_mc.tag_text.border = false;
_root.caption_mc.tag_text.htmlText = tag;
_root.caption_mc.tag_text.setTextFormat(tag_format);
_root.caption_mc.tag_text._y = ((mask._height - _root.caption_mc.tag_text._height) - 20);
picture_h2();
}
function picture_h2() {
if (_root.counter == 1){
if (_root.caption_mc.tag_text.htmlText == ""){
if (h2.placement != "everywhere"){
h2.gotoAndPlay("everywhere");
_root.caption_mc.tag_text.htmlText = "";
} else {
h2.gotoAndPlay("anywhere");
_root.caption_mc.tag_text.htmlText = "";
}
} else {
h2.gotoAndStop("nowhere");
}
}
}
if (slideshowpause == false){
nextImage();
}
if (_root.imagesCached == true && firstImageLoaded == false){
firstImageLoaded = true;
images_mask.gotoAndPlay(2);
images_mask_border.gotoAndPlay(2);
}
previous_button.onRelease = function() {
if (slideshowpause == false){
_root.counter = (_root.counterLimit + 1);
prevImage();
gotoAndPlay(5);
} else {
_root.counter = (_root.counterLimit + 1);
prevImage();
gotoAndPlay(5);
}
};
next_button.onRelease = function() {
if (slideshowpause == false){
_root.counter = (_root.counterLimit + 1);
nextImage();
gotoAndPlay(5);
} else {
_root.counter = (_root.counterLimit + 1);
nextImage();
gotoAndPlay(5);
}
};
pause_button.onRelease = function() {
trace ("Root Time = " + _root.time);
if (slideshowpause == false){
slideshowpause = true;
_root.slidetime = _root.time;
trace ("Play");
}
if (slideshowpause == true){
slideshowpause = false;
_root.slidetime = 1000000;
trace ("Paused");
}
};
Some help sorting this oddity would be much appreciated.
Import Oddity
Why is the declaration:
ActionScript Code:
import fl.controls.Button;
perfectly okay in one of my AS3 .fla files, but I receive:
ActionScript Code:
1172: Definition fl.controls:Button could not be found.
in a separate (new) AS3 .fla file??
ParseFloat() Oddity
Hello,
This is one of the most bizarre things Iâve seen in actionscript: comparing 2 numbers and it comes out wrong.
In the code below, for some odd reason â312346.46â, parsed to a float, then multiplied by 100, and compared to 31234646 is wrong. Seems any kind of comparison is wrong. Yet values like: â390000.16â compared to 39000016, gone though the same thing is correct.
However, Iâm not sure if this is really a âfixâ as I donât even know whatâs wrong, if I wrap Math.round() around everything, it seems to be okay. (Though, this could cause problems in the future...)
Replacing:
var balance:Number = parseFloat(inputString) * 100;
with:
var balance:Number = Math.round(parseFloat(inputString) * 100);
Any ideas?
Attach Code
function runTest(inputString:String, inputNumber:Number):Void {
var balance:Number = parseFloat(inputString) * 100;
//var balance:Number = Math.round(parseFloat(inputString) * 100);
var mainNumber:Number = inputNumber;
trace(balance +" > "+mainNumber +" = "+ (balance > mainNumber));
trace(balance +" < "+mainNumber +" = "+ (balance < mainNumber));
trace(balance +" == "+mainNumber +" = "+ (balance == mainNumber));
trace("
");
}
runTest("895657.46", 89565746); // true, false, false <-- this is incorrect
runTest("312346.46", 31234646); // true, false, false <-- this is incorrect
runTest("390000.16", 39000016); // false, false, true <-- this is correct
runTest("194000.16", 19400016); // false, false, true <-- this is correct
Edited: 07/21/2008 at 05:31:44 PM by Some1Won
ComputeSpectrum Oddity
I've got a spectrum visualization, that is working great locally, however, not working at all live. The sound is playing and everything else is function as should, just the visualization isn't. Not sure what I need to provide to help solve this, cause it seems very odd. Any ideas?
Xml + Namespace Oddity
Greetings all
i got this xml that i want to trace out a few nodes from into flash
with all the guts i got i immediately took it in to AS3.
now, heres the blanked out original xml
Code:
<response xmlns="http://developer.aim.com/xsd/presence.xsd">
<statusCode>200</statusCode>
<statusText>Ok</statusText>
<data>
<users>
<user>
<aimId>HIMYNAMEIS</aimId>
<displayId>HIMYNAMEIS</displayId>
<state>offline</state>
<presenceIcon>http://o.aolcdn.com/aim/img/offline.gif</presenceIcon>
</user>
</users>
</data>
</response>
for the obscure reason i can perfectly trace out the xml in flash
but i simply can't get around the xmlns url
by now iam too tired to actually write my guesses down but here is my WIP code
any help is more then welcome Thanks
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener (Event.COMPLETE, onLoaded);
var xml:XML;
var NS:Namespace = new Namespace("http://developer.aim.com/xsd/presence.xsd");
function onLoaded (e:Event):void
{
//
var xml = new XML(e.target.data);
var xmlLIST = xml.NS::data;
trace ("xmlLIST = " + xmlLIST);
}
which traces out
Code:
xmlLIST = <data xmlns="http://developer.aim.com/xsd/presence.xsd">
<users>
<user>
<aimId>HIMYNAMEIS</aimId>
<displayId>HIMYNAMEIS</displayId>
<state>offline</state>
<presenceIcon>http://o.aolcdn.com/aim/img/offline.gif</presenceIcon>
</user>
</users>
</data>
in other words i can't get past the xmlns url by any means
according to my books/online tutorials i found about name spaces
i have to do xmlLIST.NS::data::users::user::aimId to acces my aim name
usually you first setup a xmlList but that doesn't work in this case.
but it just doesn't go beyond the data tag.
pretty annoying as i got it to work in AS2 in a matter of minutes.
any help is more! then welcome cuz i am baffled.
Masking Oddity
I have a component that attaches a substantial number of movie clips to itself as it initializes. The component, once created, is masked by a pane via setMask. The masking is behaving strangely, however.
The component is draggable, the idea being that it can be dragged around the pane, but is not visible when dragged outside of the pane boundaries. Some of the constituent clips of the component show through the mask, and some do not. Some seem to flicker in and out as I drag the whole unit around. Only one of the clips reliably is visible. Additionally, some of the other clips are visible outside of the pane. If I take a component and invoke setMask on it, do all of its child MovieClips also inherit the mask?
And one last thing -- some of the constituent clips contain text.. and the text seems to show outside the masking area no matter what. Is there some special procedure for masking MC's containing textfields?
Thanks,
T
RemoveMovieClip Oddity
Paste the following code into a new .fla and test it. You'll get a green rect and a red triangle. Click the triangle and it traces
"_level0.box
yes box!"
because it still exists, then the green rect goes away.
Now click the triangle again and it should trace
"no box!"
because it's gone, however it passes the if test, and traces
"//blank line//
yes box!"
How do I fix this so it fails the if test?
ActionScript Code:
var myObj:Object = new Object();
//
_root.createEmptyMovieClip("box", 100);
box.beginFill(0x00ff00);
box.lineTo(50, 0);
box.lineTo(50, 50);
box.lineTo(0, 50);
box.lineTo(0, 0);
box.endFill();
//
_root.createEmptyMovieClip("btn", 200);
btn.beginFill(0xFF0000);
btn.moveTo(50, 50);
btn.lineTo(100, 100);
btn.lineTo(0, 100);
btn.lineTo(50, 50);
btn.endFill();
//
myObj.box = box;
//
btn.onPress = function() {
trace(myObj.box);
if(myObj.box){
trace("yes box!");
}else{
trace("no box!");
}
removeMovieClip(myObj.box);
};
Input Text Field To Dynamic Text Field
Ok, I have an input text field with a variable name of "enter", and a dynamic text field with a variable name of "display". I also have a button on the stage. I want it so that when you press the button, it checks what the user has put into the input text field, and if it is valid it will display a certain message in the dynamic text field.
For example:
If the user types in "hydrogen" and then clicks the button, I want the dynamic text field to display the letter H. Likewise, if the user types in "oxygen" and then clicks the button, I want the dynamic text field to display the letter O. And finally, if the user types in something that is not specified in the code, it will just display "Not Valid".
I tried doing this with an on(release) action and then some if statements, but nomatter what I typed in it would always display H. I'm probably overlooking something simple, but nonetheless, I need help. Thanks
Input Text Field Into Dynamic Text Field
Hey guys,
I'm really new to AS 3.0. I would like to transmit information from an input text field into a dynamic text field once a submit button is clicked.
Any help would be greatly appreciated.
I'm using CS3 AS 3.0. Thanks!
XML And MC Text Field Propigation (text Field Appear At Frame 2)
I am using xml and actionscript to propicate two fields in a mc.
The problem I am having is that both fields dont show up until the second frame of the mc. since they are not on the first frame the xml doesnt propicate the fields.
Is there any way to refence a field on the second from of a MC
I am using the following code:
Code:
function loadXML(loaded) {
if (loaded) {
_root.attractions = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.description = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.theaterinfo.header.text = _root.attractions;
_root.theaterinfo.description.text = _root.description;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("attractions.xml");
stop();
The text boxs header and description dont appear until the second frame of the MC theaterinfo
If i move these text field to the first frame they propigate with their text just fine. once they are moved to the second frame they no longer work.
edit: I also would like to mention that the movie clip theaterinfo has frame one blank with a stop(); command and then on frame 2 the dynamic text fields are referenced.
all help is much apreaciated
Thanks
Asp Database Field Loaded Into Dynamic Text Field -HELP
Hi all,
after much trial and error and still having troubles i thought i would ask people that maybe know what there doing.
Im using Flash 8 pro, and have placed textarea component on stage and gave it an instantce name, need to pull a single record from a record database using asp.
This is my approach but if there is an even easier way let me know.
I have created the following pages.
webpage.asp (end result web page that shows the text field to user)
script.asp( asp script that sends data back/forth to flash
i used the FlashVars param to pass a variable into the flash movie.
variable is named auto_num. im using this to then pass it back out of flash to filter the recordset.
then on the flash movie.swf. all on root level. i have the following code
var text_value; //(this is the value sent back from asp page string)
//not sure if i needed to declare it but did anyways.
var_sender = new LoadVars();
myData = new LoadVars();
var_sender.auto_number = auto_num //(auto_num is loaded flashvars param)
myData.onLoad = function() {
my_text_1.text = this.text_value
};
myData.sendAndLoad("http://www.********.com/script.asp", myData ,"POST");
on the script page i have a record set that filters for form variable named auto_number. all of code is in asp. I call a response.write to write the text_value back to the flash movie.
here is the heart of the script.asp code. not showing the record set filtering stuff.
<% Dim text_value
text_value = "text_value="&(Recordset1.Fields.Item("long_des"). Value)
response.write(text_value)
%>
but i get undefined and can never get the variables to load into the flash movie. i want to export as flash player 6 or 7. what am i doing wrong here?
So in a nutshell, i have an asp page that shows a record and would like to display the long description field of that record in a flash dynamic text box.
I can make it work by passing the entire long description from record set within the flashvars param but that seems like a real clunky way to do it pasing that much text within the flashvars param.
Does anyone know of simple database connectivity kits that extend flash for the semi-programmer guys?
Foward Back Oddity
basically I am trying to go foward, stop, play, and go backwards.
I am doing it by using these functions(which are inside a menu MC):
_global.x = 1;
function foward(){
x=+1;
_root.allclothes.gotoAndStop("x");
}
function backward(){
x=-1;
_root.allclothes.gotoAndStop("x");
}
function playhead(){
_root.allclothes.gotoAndPlay(_root.allclothes._cur rentframe);
}
function pausehead(){
_root.allclothes.gotoAndStop("x");
}
In the allclothes MC I have labeled every 20 frames with 1 and 2 etc...
also with every 20 frames I have added the variable x=1 or 2 etc..
can anybody tell me what I am doing wrong???
this shouldn't be that complicated (me thinks)
thanx
'this' Oddity Which Is Driving Me Insane
i made the following code to dynamically retrieve info from a php script which got the info from mysql. (i have made some changes to test it and figure out what my problem with it was)
Code:
var tunesArray:Array = new Array();
function getDetails() {
tunes_box.tune_box_0.name_txt.text = tunesArray[0][0];
tunes_box.tune_box_0.format_txt.text = tunesArray[0][1];
tunes_box.tune_box_0.comment_txt.text = tunesArray[0][2];
}
function doAfterLoad() {
if (this.numRows>0) {
for (i=0; i<this.numRows; i++) {
tunesArray.splice(i, 0, [this["tunename"+i], this["tuneformat"+i], this["tunecomment"+i]]);
}
}
getDetails();
}
var tunesLoadVars:LoadVars = new LoadVars();
tunesLoadVars.onLoad = doAfterLoad;
tunesLoadVars.load("php/tunes.php");
this code worked fine in a movie of its own. It gets info from a php script which gets it from mysql and then displays the info in a text box ( i removed the dynamic stuff in 'getDetails' to test this script after i found it didn't work anymore).
to cut a long story short, after a lot of frustration i figured out that if i changed the two instances where it says 'this.numRows' to a variable which i created previously it worked fine (e.g. i created 'rows = 4;' and then used 'rows' in place of 'this.numRows') but only if i also changed the input data from the 'splice'. i changed the first part of input data from the splice from 'this["tunename"+i]' to ' "funky" '. if i used 'this.numRows' then funky didn't show up in the 1st text box, but if i used the var 'rows' which i created, then funky did show up in the 1st text box. in neither situation did the other 2 pieces of data show up in the text box.
Therefore i think the problem is with the use of 'this' in the script.
In the original movie when i made this code to test it, the actionscript was on the main timeline in a layer called 'actions'. In the new movie where i am trying to use the code, it is also in a layer called 'actions' on the main timeline.
I can't figure out why 'this' suddenly stops working even though all of the conditions are the same. I tried '_root' and also just removed the first part altogether to show 'numRows' or '["tunename"+i]' in the splice but they didn't work.
As the code shows, 'numRows' is stored in a loadVars variable. I have tried different ways of representing it that way, 'tunesLoadVars.numRows' and 'tunesLoadVars[numRows]' but nothing works.
can anyone explain this oddity to me? it might be really simple but i am about to start going insane trying to figure this out. can i just use the variable from the loadVars object instead of using 'this'?
cheers
Flash UI Componentsoddity
I am experiencing the oddest UI comboBox problem... I have a dropdown that's being populated from an XML file. If you click on the component to drop down the list and then (before selecting any option) hit any key on the keyboard... the dropdown clears itself and becomes empty. Does anyone know what's going on? Is there a way to prevent that from happening? Or alternatively, can you disable keyboard feedback? Please help if you can.
Thanks!
Issue With HitTest Oddity
I'm creating a game sort of thing. I've got a targeting movie (tag) clip that replaces the cursor. The idea is, when the targeting mc hitTests a movie clip inside another movie clip (zombie.head), and you click the mouse button, an animation plays. But the weird thing is, if you run the target across the head movie clip, move it away and then click the button, the animation still plays.
Here's my code:
ActionScript Code:
tag.onMouseMove = function() {
tag._x = _xmouse;
tag._y = _ymouse;
updateAfterEvent();
if (this.hitTest(zombie.head)) {
gunListener.onMouseDown = blastEm;
}
};
When I place the hitTest code outside of the onMouseMove function, then it doesn't work at all. Any one have any ideas on how to make it work properly?
Netstream Seek Oddity
Hi,
I'm currently working on a video playing app, and all is fine, except for one odd bug.
I have a standard seek drag bar. When the video is paused at start and I used that seek bar, the video will seek to the point I drag to, then when it plays, will play OK for a second or so, then either pause for the amount of time I set the seek for and then play again normally, or simply jump to some odd point.
If I play the video, and then use the seek bar, it works perfectly.
I tracked all the relevant stream times etc, nothing seems amiss, but for some reason, when you seek to a point from a paused (at start) file it seems to crap out. It seems that Flash needs to play the file for a little bit to get itself all in sync.
Has anyone encountered anything like this, any work arounds?
Heres my seek function, which acts as a setter in a video class;
ActionScript Code:
//set current video seek public function set SeekPointAsPercent(newPercentPos:Number) { if (videoMetaData!==null) { var newVideoPos:Number = videoMeta.duration*newPercentPos; videoStream.seek(newVideoPos); } else { trace("Attempting to access video meta data before we have any!"); } }
I should note, this is for progressive video, and the file is completely loaded.
Flash UI Componentsoddity
I am experiencing the oddest UI comboBox problem... I have a dropdown that's being populated from an XML file. If you click on the component to drop down the list and then (before selecting any option) hit any key on the keyboard... the dropdown clears itself and becomes empty. Does anyone know what's going on? Is there a way to prevent that from happening? Or alternatively, can you disable keyboard feedback? Please help if you can.
Thanks!
_height In For Loops Oddity
Hi guys
i once got it to work but i can't figure out how.
i blame tiredness atm but a job must be done.
Code:
var items:Array = new Array ("Weddings:
Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext", "Portrait engagement", "Portrait child", "Portrait pregnancy", "Portrait headshots", "Portrait family", "Portrait senior", "Commercial", "Modeling portfolio", "Comp card", "Industrial", "Restoration", "Underwater", "Action", "Fine arts", "Manipulation", "Digital", "Black & white", "Color", "Travel", "Web work", "Design", "Photo journalism");
castMenu = function ()
{
for (var a:Number = 0; a < items.length; a++)
{
trace ("a = " + items.length);
var t = attachMovie ("button", "button" + a, a + 10);
t.id = a;
t.txt.autoSize = true;
t.txt.text = items[a].toUpperCase ();
t._x = 0;
/* not sure about this part.
t.lineMC._y = t.txt._height + 5;
t._y = (t.txt._height+10) * a;
*/
t.onRelease = function ()
{
trace ("this is = " + items[this.id]);
};
}
};
castMenu ();
so my problem is that the line mc is perfectly 5 pixels under the total height of txt (txt is a straight on dynamic textfield)
but my actual buttons (t) are all jagged up; i'd love them to position
10 pixels underneath the last casted item. how can i best fix this? i am bit stunned atm.i thought autoSize was the trick right, it has multiple lines enabled
i tried putting the lineMc code & autoSize inside the button mc but to no avail.
could anyone point me out here? thank you.
Keyboard Listener Oddity - Any Ideas?
Hi folks, I'm trying to catch "delete" keys and I use a key listener for that. Only... it seems that some keys, including delete just don't trigger that listener. Did I do anything wrong? Any ideas?
When I use this I see "key" for every normal character I press, but I never see "del" and -- more than that -- I don't even see "key" when I press the Delete key. It seems delete doesn't send the key event for whatever reason (neither does backspace, etc.)
<pre>
KeyListener = new Object();
KeyListener.onKeyDown = keyHandler;
Key.addListener(KeyListener);
function keyHandler() {
trace("key!");
if (Key.isDown(Key.DELETEKEY)) {
trace("del");
}
}
</pre>
Ideas? thoughts? Advice?
Juggle5
HitTest Shape Flag Oddity
I have two items inside a movieclip.
I want to run a hitTest to see whether they are colliding.
ActionScript Code:
parent_mc._x = 50;
parent_mc._y = 50;
//
parent_mc.ball_mc.startDrag(true);
//
this.onEnterFrame = function() {
if (parent_mc.shape_mc.hitTest(parent_mc.ball_mc._x, parent_mc.ball_mc._y, true)) {
text_txt.text = "Hitting";
} else {
text_txt.text = "";
}
};
As you can see, both of the items are inside a movieclip parent_mc
When the movie runs, the hittest does work, but for some reason the co-ordinates are not correct - the hittest operates with an offset of 50 pixels on the x and y (the position of the parent_mc). It seems that the hitTest() function converts the co-ordinates of the dragging item to stage co-ordinates!
so, this fixes the problem:
ActionScript Code:
parent_mc._x = 50;
parent_mc._y = 50;
//
parent_mc.ball_mc.startDrag(true);
//
this.onEnterFrame = function() {
if (parent_mc.shape_mc.hitTest(parent_mc.ball_mc._x+parent_mc._x, parent_mc.ball_mc._y+parent_mc._y, true)) {
text_txt.text = "Hitting";
} else {
text_txt.text = "";
}
};
It's going to complicate my code quite a bit to keep having to compensate for this so I was wondering if anyone has any more info about it... maybe there's a workaround so I don't have to write that compensating element into my hitTest functions?
Any help appreciated.
Escape /unescape Oddity In Arrays
HI,
i have a data array that im breaking up correctly for what i need, but ive started adding smaller arrays 'escaped' into this array so that when i break it up i can unescape the sub arrays for my purposes.
eg:
dataarray=1,2,f,2,4,%20ghgj%kglf,2,3 ( the escaped %% bit altho not proper escaped is just to show as example where it stands)
so when i extract the %20ghgj%kglf from the data array i can unescape it into a further array of
subarray=20,ghgj,kglf
now this seems to work fine on testing but on publishing doesnt work and by deduction sems to be the problem, ( if i remove the escaped section of the array and replace with a normal variable things work)
are there any known problems with escape/unescape in arrays that i am missing?
many thanks for your time
shane
A Potential Oddity In Math.random()?
I was testing a random number function I 'made' that uses Math.random(), when I found a strange oddity in it. Letâs say my number range is from 0 to19. After generating 10000 random numbers with my function, the percentage of each number to the total times I generated is pretty even except for the first and last number. For some reason the percentage of my first and last number is always roughly half of the percentage of the other numbers.
You can see for yourself with the attached code below.
With the values Iâve put in the result printed is:
Total generations: 10000
0 Count: 288 2.88%
1 Count: 537 5.37%
2 Count: 544 5.44%
3 Count: 533 5.33%
4 Count: 537 5.37%
5 Count: 553 5.53%
6 Count: 544 5.44%
7 Count: 510 5.1%
8 Count: 531 5.31%
9 Count: 518 5.18%
10 Count: 535 5.35%
11 Count: 488 4.88%
12 Count: 519 5.19%
13 Count: 518 5.18%
14 Count: 516 5.16%
15 Count: 522 5.22%
16 Count: 487 4.87%
17 Count: 532 5.32%
18 Count: 523 5.23%
19 Count: 265 2.65%
Iâd like to say that there is something wrong with my randomNumber() function, but at the moment, I canât seem to see what could be wrong with it. Any ideas?
*Ah, I just discovered interestingly, if you run that in AS2 (and even running it in flash 8) you donât get that odd result and all the numbers generated are evenly distributed (more or less).
Seems only in AS3 it happens.
Attach Code
// generates a random number from min to max (excluding max)
function randomNumber(min:Number, max:Number):Number {
return Math.round(Math.random() * (max - min - 1)) + min;
}
// number range is from 0 to 19
var numberRange:Number = 20;
var array:Array = new Array(numberRange);
// test generate max
var totalNumbers:Number = 10000;
trace("Total generations: "+ totalNumbers);
// set all the numbers to 0 in the array
for(var i:Number = 0; i < array.length; i++){
array[i] = 0;
}
// generate the random numbers and count the number generated
for(var counter:Number = 0; counter < totalNumbers; counter++){
array[randomNumber(0, array.length)]++;
}
for(var z:Number = 0; z < array.length; z++){
// trace the number, the amount of times it was generated, and its percentage of total generations
trace(z +" Count: "+ array[z] +" "+ (Math.round(array[z] / totalNumbers * 10000)/100) +"%");
}
Edited: 02/17/2008 at 04:27:16 AM by Some1Won
[F8] Enable/disable Label Component Oddity
Strangest thing... was wondering if anyone else has ever seen this problem?
Code:
this.myButton.onRelease = function() {
this._parent.myLabel.enabled = false;
}
syntax is right, target is right... but no worky.
I can disable the Label component at compile-time, but can't modify the setting at runtime. any ideas?
Text Tab Order
Can anyone help me with setting the tab order of text feilds any hlp please (Stuck)
Tab Order For Text Fields
I'm using Flash 5 and need to save to a Flash 4 player. I need to either disable the tab order for my form fields or set a sequential tab order for the Flash 4 player. Does anyone know how to do this?
Help Have Text Field Tab To Next Text Field Auto
Example:
I'm trying to get 7(a-g) input boxes (max 1 character) to tab automaticaly when the user enters a character in the text field.
text box(a) goes to text box(b) and so on.
once a character has been enterd.
I can't figure it out, is it even possible?
Thanks
Loaded Text File Wont Show All Of The Text In Dynamic Text Field
When I load an external text file into flash and display the string in a dynamic text box, not all of the text will show in the text box; and using scroll button to scroll the text doesnt help.
The text that is in the text file is as follows, and as far as I can see there is no reason why all this text shouldnt show in the dynamic text field; by the way all my targets are correct, I know that for fact.
message=Code: Cheat:
BEEPSAGONER Deactivate the censor beeps
DRACULASTEABAGS 50 lives
DUTCHOVENS Frying pan mode
XFYHIJERPWAL IELWZS Debug mode
BOVRILBULLETHOLE Shoot all objects
EASY Easy mode
VERYEASY Very easy mode
SPUNKJOCKEY New death animation
SEXYMANN Birdy & Squirrel scene
Code: Unlock chapter:
PRINCEALBERT Barn Boys
CLAMPIRATE Bats Tower
ANCHOVYBAY Slopranos
MONKEYSCHIN Uga Buga
SPANIELSEARS Spooky
BEELZEBUBSBUM It's War
CHOCOLATESTARFISH The Heist
WELDERSBENCH All chapters and scenes
Code: Unlock Multiplayer character:
WELLYTOP Conker
EASTEREGGSRUS Neo Conker
BILLYMILLROUNDABOUT Gregg the Grim Reaper
CHINDITVICTORY Weasel Henchmen
EATBOX Cavemen
RUSTYSHERIFFSBADGE Sergeant and Tediz Leader
BEEFCURTAINS Zombies and Villagers
Tab Order Of Input Text Fields
oke here is the deal.
im building this site.. http://www.agdgraphics.nl
its dutch but that doent matter to the problem...
the menu "CONTACT" and then "INFO AANVRAGEN"
there is a CFMAIL script someone fills in the form and it automatically mails the thing.. that part works.. please don't mail cause its linked to my own email now..
but youll see that the Tab order is not right..
if you fill in the email line and you press tab to go to the next field.. it jumps to the adres field.
and if i change the fields places and rename them.. it still jumps to the wrong one..
how do i make it work properly?
thanks in advance.
Martijn.
Tab Order Of Input Text Fields
I am wondering if anyone knows of a way to set the tab order of input fields in a form. I searched this forum and found a suggestion to set up a button that will run a bunch of if statements when a user hits the tab button. That suggestion will work but was posted about two years ago and I am hoping that a new solution has been discovered since then.
Input Text Fields And Tab Order
Flash MX
I have a form with several text fields inside a movie clip.
I want to specify tab order using:
field1.tabIndex = 1;
field2.tabIndex = 2;
etc
But having given my input fields an instance name, they now appear in the movie with what appears to be their path inserted:
_level0.movieclip.field1
Whats happening and why!???
Also, how do I specify a field to be ignored by the tab order?
Thanks
[MX04] Text Input In Order
I have a external txt file loading names into a text box in flash.
At the moment the script chooses the names randomly. I would like it to choose the names in the order i have them in the txt file from 1 through to 30.
i am really new to flash, trying to accommodate a script i found on the net to do what i want. Obviously I'm not doing too well.
All files are attached.
thanks in advance
Input Text Fields And Tab Order
Flash MX
I have a form with several text fields inside a movie clip.
I want to specify tab order using:
field1.tabIndex = 1;
field2.tabIndex = 2;
etc
But having given my input fields an instance name, they now appear in the movie with what appears to be their path inserted:
_level0.movieclip.field1
Whats happening and why!???
Also, how do I specify a field to be ignored by the tab order?
Thanks
Input Text Fields To Tab In Order?
I'm on a roll today.
I know there is a method to the madness regarding how Flash reads the order of input text fields. I happen to not know it <
Of course, mine don't tab in order from L to R then Down. The fields are all different sizes so I assume the order takes this into account. I copied and pasted the input text boxes in a logical fashion but they're all screwy regarding tabbing order.
How do I set them straight?
* Scottie
I can design a city but can't fix a pipe.
How Do I Assign Tab Order For Combo Box & Text Box?
I have a page that contains several controls, (buttons, text box, combo box). I would like the focus to be toggled between the combo box and text box only. I created an invisible button and added the following code to it:
on (keypress "<Tab>") {
if (Selection.getFocus() == "root.options") {
Selection.setFocus("root.search");
} else if (Selection.getFocus() == "root.search") {
Selection.setFocus("root.options");
}
}
When I try to toggle now, nothing happens. I think the above code works for text boxes, but how can I get the combo box to work as well. Any suggestions would be appreciated. Thanks!
Help W/ Tab Order For Flash Input Text Boxes?
Hi,
I am totally stumped as to how to set the tab order for my email page in Flash where it works on my HTML page (my tab order is going from the 1st input box - tab then goes to URL). I found some code but cannot seem to get it to work :-( Any suggestions??
Thanks!
Jen
Read From Text File In Score Order?
Hi, I'm not too happy about having to use a text file this this purpose, but the client inists, so...
I haev to store a scoreboard in a text file. I can store data easily BUT when i read it back in it has to be in order of score. Anyone know how to do this? Below is an example of the txt document:
name1=james&score1=50&name2=sam+score2=100+name3=p ete&score3=40;
...it reads in back in the following order
James 50
Sam 100
Pete 40
... but I need it in the order of score, i.e.
Sam 100
James 50
Pere 40
It's really doin my head in. Any help appreciated
|