Failing Buttons After Loading Ext. Swf's
Hi there I have a problem with loading externam .swf using the masking tutorial...
http://www.kirupa.com/developer/mx/p...transition.htm
Well I get the first scene to load. but i cant controll it with my buttons after that .. please check out attached file .
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 03-13-2004, 10:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Failing Buttons After Loading Ext. Swf's
Hi there I have a problem with loading externam .swf using the masking tutorial...
http://www.kirupa.com/developer/mx/p...transition.htm
Well I get the first scene to load. but i cant controll it with my buttons after that .. please check out attached file .
Combo Box And Buttons Failing
I have built a flash file and put this onto our website at http://www.school-portal.co.uk/GroupHomepage.asp?GroupID=320416.
It seemed to work fine but now, in Firefox, the combo boxes and buttons are not working. It all works fine in IE7 but not Firefox.
Any ideas?
F8 External Swf Buttons On Release Failing
Issue with external flash. When an external flash presentation (5 screens, 1 main, 4 subs) is loaded into another flash presentation (1 main, 1 sub : preloader progress bar method) the buttons (movie clips not components) no longer work.
The actionscipt code:
on(release){
this.rootSlide.gotoSlide(_level0.Slide1.Slide2);
}
Code works when the external fla is run by itself.
The buttons should load the screen contents in the external Flash presentation when clicked. They register as buttons (mouse pointer turns into hand), but the on(release) event gets suppressed inside the external flash presentation when loaded into another "frame" flash presentation.
No one seams to understand why this would not work. No one has had similar problems that I can see. Any help is appreciated. Has anyone ever encountered this or has a solution?
Thanks for looking... cheers!
Loading Failing On Some Computers
Hi, i have a flash site that is around 800k in size the site will load on my computer every time and i have tested it on others and it loads fine, but my client has said some people can not get it to load every time, like it will stop at 61% or another is 38%
so my question is, are some loading scripts more reliable to than others or is it more to do with the persons pc or internet connection? if anyone has any ideas how i can sort this so i know it will load every time even if it does take a few mins i would rather it loaded to 100% than not load at all..
thanks
Loading External CSS-file. Want Error Messages If Failing-HELP
I'm loading an external css-file for a dynamic textfield that is taking it's content from an external txt-file. I want some error messages to appear if it doesn't succed to load css or external txt-file. The problem is that if erase the css or txt file I just get nothing. It's completely blank. What am I doing wrong? news.newsText1.embedFonts = true; was needed for the css to work-I'm also using shared fonts with a shared library file. My code is below...help would appreciated....thank you.
Niklas
//----------------<LOAD CSS>------------------------\
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles.css");
var myLV:LoadVars = new LoadVars();
cssStyles.onLoad = function(success) {
if (success) {
news.newsText1.styleSheet = cssStyles;
myLV.load("home/home.txt");//-<LOAD VARS>
} else {
news.newsText1.text = "There has been an error loading this section.";
}
myLV.onLoad = function(success) {
if (success) {
news.newsText1.htmlText = myLV.news;
} else {
news.newsText1.text = "There has been an error loading this section.";
// ----------------<END LOAD VARS>
}
}
};
news.newsText1.embedFonts = true;
//----------------<END LOAD CSS>--------------------\
HELP PLEASE...xml Failing
ok, i've posted a couple of times to no avail...so i'll get more specific. i am trying to load xml data into a text box. i've tried it a million ways and for some reason every time i introduce an image into the mix it crashes flash.
the samples are here:
http://www.wastedspaces.com/resources/failed_xml.zip
i have use xml files to produce text before and haven't had any problems. i used loops to separate the groupings of nodes as i need to (see version1.fla), but for some reason this is guaranteeing a crash when an image is used.
so, i tried just using the whole block of xml data at once (see version2.fla) and just using p tags and br's to format the data, but didn't have any luck there either, as the nodes were all bunchin up on top of each other. besides, that started crashing too.
this is crazy, i must be missing something very obvious.
Failing Contructor?
Can anyone spot the error in my code? For some reason, the Piece object does not seem to be instantiated. The following code outputs "pieces[n] still null!" four times (and yes, the movieclips "red_piece_1" etc do exist and gets refenced by the eval(), otherwise it wouldnt reach that far).
Code:
var color = "red";
for (var i = 0; i < 4; i++) {
var pieceName = "_root." + color + "_piece_" + (i+1);
var pieceMoveClip = eval(pieceName);
if (pieceMoveClip != null) {
pieces[i] = new Piece(pieceMovieClip);
if (pieces[i] == null) {
trace("pieces["+i+"] still null!");
}
}
}
/*
* Piece class definition
*/
function Piece(movieclip) {
this.movieclip = movieclip;
}
Piece.prototype.movieclip = null;
Piece.prototype.grid = -1;
Piece.prototype.advance = PieceAdvance;
Piece.prototype.toString = PieceToString;
function PieceToString() {
return "[Piece " + movieclip == null ?
"with movieclip" : "no movieclip" + "]";
}
function PieceAdvance(n) {
move_piece_to(this, this.grid);
}
Where Is My Script Failing......?
Hi ---
I am hoping someone can assist with my problem. I have struggled with this for the last day and know that I am close to getting it done, but I desparately need some guidance.
1)I have a movie clip (1st) that has a number of text boxes --which basically is a contact us form
2)That form then sends the data to an asp page
3)The ASP page processes the data and sends off an email with the relevant data
4)While the data is being processed (by ASP) another movie clip (2nd) runs stating that the email is being sent
5)Once the email is sent ---the ASP page is supposed to send back a variable informing the movie that is was successful.....the 2nd movie clip should then stop.
Step 5 is where the process is failing. The email gets sent but I can not propertly get the ASP page to communicate with the Flash Object.
I have uploaded the FLA if anyone wouldn't mind taking a look at it and providing some feedback.
http://www.digitalsaguaro.com/contact.fla
Thanks for any and all assistance.
Cheers.
SDL
If/else Statement Is Failing - PLEASE HELP
I've been working on this for a while and the if/else statements still aren't working correctly.
Even though it says if greater than 10 go to "congrats"
it always goes to "fail" instead.
Another problem is that one of my variables doesn't work anymore either.
I'm posting a link to the fla of the project because i really need someone to skim through it and see what I'm messing up on.
I promise that its not a sloppy file or hard to figure out.
Thanks for any help!
http://www.cruor.com/quizworking8.fla
MC Interaction Failing
im having problems trying to tell the archer (baddie_mc) to tell his arrow (baddie2_mc) to gotoAndPlay("DIE"), but it just wont work. No error message, no trace of the problem eccept that the arrow is disobeying the script. You see, when the archer dies, he goes to a frame where he is lying on the ground and in which says:
tellTarget("_parent.baddie2_mc"){
gotoAndPlay("DIE")
}
simple, or too simple?
thanks for the help.
[MX] Why Is This Code Failing?
I really cannot see where I'm going wrong with the attached code.
On the press of a “Fire” button, I want to attach an individual clip to the stage (no problem) create an object to hold information about it (again – no problem) – Give that clip an onEnterFrame event to move it round the stage from info stored in it's object (once again, no problem.)
The problems start when I click the fire button to attach another clip. Although I have dynamically named each object with an individual reference “_root["fireShell"+z]” as soon as another clip appears on the stage the old one stops what it was doing and all the actions in the code work only on the new instance. -Why? Each object is individually named so it should just be doing it's own thing!
code: z=0;
_root.fire_mc.onPress = function() {
z++;
var speed = 2;
x1 = speed*Math.cos(ang);
y1 = speed*Math.sin(ang);
grav = .01;
_root.attachMovie("shell", "shell"+z, z);
_root["shell"+z]._x = Math.floor(_root.gun1_mc._x+_root.gun1_mc.barrel_m c._width*Math.cos(ang));
_root["shell"+z]._y = Math.floor(_root.gun1_mc._y+_root.gun1_mc.barrel_m c._width*Math.sin(ang));
_root["fireShell"+z] = {};
_root["fireShell"+z].x = _root["shell"+z]._x;
_root["fireShell"+z].y = _root["shell"+z]._y;
_root["fireShell"+z].clip = _root["shell"+z];
_root["fireShell"+z].radius = _root["fireShell"+z].clip._width/2;
_root["fireShell"+z].xmov = speed*x1;
_root["fireShell"+z].ymov = speed*y1;
_root["bull"+z] = _root["fireShell"+z];
_root["bull"+z].clip.onEnterFrame = function() {
yAmount = _root["bull"+z].ymov += grav;
_root["bull"+z].x += _root["bull"+z].xmov;
_root["bull"+z].y += yAmount;
_root["bull"+z].clip._x = _root["bull"+z].x;
_root["bull"+z].clip._y = _root["bull"+z].y;
};
};
Thank you in advance for any help.
Failing Preloader
Hi,
I have built a small application where I make a movieclip from a large JPEG and then "play it" in a scrollpane (to view a number of photographs). I start with an easy preloader of three frames, usual stuff where I have a bar and "% loaded " and "bytes loaded /total". Everything works fine but preloader doesn't become visible until 40% is loaded. Preloader approx 32 K acc. to test. Problem is that JPEG of 1,5 M I load in frame 3, after preloader, is loaded in frame 1.
Preloader:
Frame 1: checks, if 100% goto frame 3.
Frame 2: goto frame 1.
Frame 3: "start" label
Movie:
Frame 3: one small JPEG with "shaded frame".
Scrollpane that plays my movieclip "paintings"
"Paintings", Symbol made out of big JPEG.
Start some music.
Works perfect but preloader not visible until 40% loaded which is "too late",
What is the problem? WHy does Flash load big JPEG in frame 1?
Thanks,
Bostallet
NetConnection Failing After First Try
I have a small audio stream between two clients in a chatroom app (using Red5 for the streaming). Now when I connect to Red5 on the first try everything works just fine. If I close the app and try again I get the following error:
Code:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Connect.Failed
at lmt_tutor_test2_fla::MainTimeline/lmt_tutor_test2_fla::frame1()
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Connect.Failed
at lmt_tutor_test2_fla::MainTimeline/lmt_tutor_test2_fla::frame1()
the code for the connection:
Code:
var ns_in:NetStream;
var ns_out:NetStream;
nc_out.connect("rtmp://localhost/oflaDemo");
nc_in.connect("rtmp://localhost/oflaDemo");
pretty straightforward.
The really strange part is that if I restart Tomcat ( I also have Tomcat5 running on the same machine) it will work again (only the first time).
I don't have Tomcat touching a port anything close to what Red5 uses so how does restarting that webserver affect the NetConnection?
Anyone else ever have this same sort of problem with NetConnection?
Thanks in advance.
SwapDepths Failing
Finding it impossible to swap the depths of the mcs stored in an Array. Can anybody see anthing wrong with this:
Code:
private function transition( _transSpeed:Number):Void{
var nextPage:MovieClip = page_ar[pageTracker];
trace(nextPage)// Traces the correct Mc
nextPage.swapDepths(1000);
var nextPageDepth:Number = nextPage.getDepth();
trace(nextPageDepth)//Traces the original depth
tween_lst.onTweenEnd = Delegate.create(this, transComplete, nextPage, nextPageDepth);
myTween.addEventListener("onTweenEnd", tween_lst);
myTween.tweenTo(nextPage, "_alpha", 100, _transSpeed, Quad.easeOut);
pageTracker++;
pageTracker = (pageTracker > page_ar.length-1) ? 0 : pageTracker;
}
Thanks
LocalConnection Failing
I have written a set of movies which communicate with each other using localconnection. This works for most users. However I have a user for whom this application doesn't work. Also if I send them to the Adobe website and get them to try the local connection sample there, they report that doesn't work either.
They have the latest player 9 installed and have tried it with IE and Firefox.
They are running on windows XP.
Only thing unusual about their PC is that they have CS3 installed.
Has anyone experienced similar problems or any suggestions as to the cause.
Flash Failing On Mac
flash fails on the mac, internet explorer 5.1 and netscape. movies are not shown (on netscape) of parts of the graphics disappear (when resizing the window, explorer).
Older work i did never gave me these problems. I can't see a possible source of evil in the fla: anyone got a clue?
(format is flash 5)
Failing In Pure AS3 Gui
Hello, this is my first post, and i need some help.
Currently i am trying to replace an AJAX gui with a pure-AS3-flash version, however, i have one *big* problem ( and maybe i'm just "google-impaired", but could not found any working examples online ):
on my gui, the user drags elements around ( Sprites are working fine ), click on the element to have a menu ( eventListeners and ContextMenu are very nice ) and can open up a modal-window with selectors ( and here lies my trouble ).
The window should have one first "select-box", given the selection, the gui fetches the data for the next selector from the server, which could be another select-box, or a text-box, or a label... i *must* build the gui dynamically, accordingly with the user's inputs.
Well, right now i'm absolutely frustrated that i can't even place a static select-box ( or a button ) on the stage
for instance, here http://willperone.net/Code/as3ui.php gave me this idea:
Code:
package {
import mx.containers.Canvas;
import mx.controls.Button;
import flash.events.MouseEvent;
import mx.core.Singleton;
import mx.resources.ResourceManagerImpl;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import flash.system.*;
public class App extends Canvas {
private var button:Button;
public function App() {
/* this should HACK-away the IResourceManager error
( http://groups.google.com/group/flex_india/browse_thread/thread/b53a0a828f1346eb )
, but it doesn't */
var resourceManagerImpl:Object =
ApplicationDomain.currentDomain.getDefinition("mx.resources::ResourceManagerImpl");
Singleton.registerClass("mx.resources::IResourceManager", Class(resourceManagerImpl));
button = new Button();
button.label = "I'm a Button!";
button.addEventListener(MouseEvent.CLICK, click);
addChild(button);
}
private function click(evt:MouseEvent):void {
removeChild(button);
}
}
}
despite the Singleton HACK, i still get this dreadful error, that aparently does not happen on a MXML project:
Code:
Error: No class registered for interface 'mx.resources::IResourceManager'.
at mx.core::Singleton$/getInstance()
at mx.resources::ResourceManager$/getInstance()
at mx.containers.utilityClasses::Layout()
at mx.containers.utilityClasses::CanvasLayout()
at mx.containers::Canvas()
at App()
i'm fixed on using pure-AS3 classes because i don't believe that MXML would play nicely with my requirements of
truly-dynamically-gui-fetched-from-server elements... no Flex-drag'n'drop, no MXML, just pure programatically AS3 classes with gui components.
Could anybody, please, point me to the right direction ? I'm really lost on how to work with select-boxes, text-fields, checkboxes and such GUI components on a pure-AS3-classes project.
(
I'm running:
$ ~/src/flex3_sdk/bin/mxmlc -version
Version 3.0.0 build 477
on Linux.
)
many Thanks in advance.
Recover Failing
After I wiped my disk and updated my OS, I reinstalled Dreamweaver/Fireworks/Flash using recover files (Recover Dreamweaver.exe, Recover Flash.exe, etc.) Everything worked except for Flash, which does the download and then gives me the error "2004 Validation error" and crashes out of the reinstall process.
I know the easy way out of this is to upgrade to CS3, and that's my plan, but right now I have to finish a project and just want to get the old version of Flash up and running. Anybody have an ideas on why this is happening? It's Flash MX.
Thanks.
Jon
Failing To Understand
Hey all, well after literally a day of trying to debug why I could not click on any of the buttons of the media player component, I discovered that the issue was the following which I still cannot understand.
Structure : A Movie Clip that contains the media player component.
Issue: When I added in a .onRollOut event for the movie clip the ability to click on any of the buttons in the media player occurs.
Reason for putting the event on the MovieClip was to hide the players mc when it is not being used.
So, if anyone would please tell me
1. why this is
2. how to get the event to work without breaking the media player interaction
Note: the entire swf is only 240 wide and the media player is the width of the stage, so I cannot use a mask around it. The reason for using the event on the mc was to detect and hide the player when the user moves off the swf from the mc or just moves off the mc onto another.
Any thoughts greatly appreciated.
NetConnection Failing On Second Try
I have a small audio stream between two clients in a chatroom app (using Red5 for the streaming). Now when I connect to Red5 on the first try everything works just fine. If I close the app and try again I get the following error:
Code:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Connect.Failed
at lmt_tutor_test2_fla::MainTimeline/lmt_tutor_test2_fla::frame1()
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Connect.Failed
at lmt_tutor_test2_fla::MainTimeline/lmt_tutor_test2_fla::frame1()
the code for the connection:
Code:
var ns_in:NetStream;
var ns_out:NetStream;
nc_out.connect("rtmp://localhost/oflaDemo");
nc_in.connect("rtmp://localhost/oflaDemo");
pretty straightforward.
The really strange part is that if I restart Tomcat ( I also have Tomcat5 running on the same machine) it will work again (only the first time).
I don't have Tomcat touching a port anything close to what Red5 uses so how does restarting that webserver affect the NetConnection?
Anyone else ever have this same sort of problem with NetConnection?
Thanks in advance.
MP3 Player That Is Failing
I'm developing a mp3 player and i'm using a empty mc to control the actionscript. The mc has this code attached to it:
onClipEvent (load) {
i = 0;
playing = "false";
songTime = "00:00";
songTitle = "No Song Loaded";
songNum = 0;
songArt = "Artist";
songList = new Array(
"ayan_track_01.mp3",
"ayan_track_02.mp3",
"ayan_track_03.mp3",
"ayan_track_04.mp3",
"ayan_track_05.mp3",
"ayan_track_06.mp3",
"ayan_track_07.mp3",
"ayan_track_08.mp3",
"ayan_track_09.mp3",
"ayan_track_10.mp3",
"ayan_track_11.mp3",
"ayan_track_12.mp3",
);
songDesc = new Array (
"S'perança",
"Primero Bez Kin Bá Cinema",
"Bespa Casamento",
"Lúa",
"Basalisco",
"Chalina",
"Repican",
"1 Minuto",
"N'kre Bejábu",
"Flan Ayan",
"Bonbolon",
"Mi Ku Bó"
);
songArtist = new Array(
"Vadú",
"Tcheka",
"Djingo",
"Princezito",
"Tcheka",
"Vadú",
"Djingo",
"Princezito",
"Tcheka",
"Djingo",
"Princezito",
"Vadú"
);
function playSong() {
if (playing == "false") {
s.stop();
s = new Sound();
s.loadSound( songList[i], true);
songTitle = songDesc[i];
songArt = songArtist[i];
songNum = i + 1;
playing = "true";
}
}
function stopSong() {
s.stop();
playing = "false";
songTime = "00:00";
songTitle = "No Song Loaded";
songArt ="Artist";
songNum = 0;
}
function nextSong() {
if (i < (songList.length - 1)) {
i++;
} else {
i = 0;
}
playing = "false";
playSong();
}
function prevSong() {
if (i > 0) {
i--;
} else {
i = songList.length - 1;
}
playing = "false";
playSong();
}
}
onClipEvent (enterFrame) {
if (playing == "false") {
_root.play_status.gotoAndStop(1);
} else {
_root.play_status.gotoAndStop(2);
}
if (playing == "true") {
songCount = new Date();
songCount.setTime(s.duration - s.position)
songMinutes = songCount.getMinutes();
songSeconds = songCount.getSeconds();
if (length(songMinutes) == 1) {
songMinutes = "0" + songMinutes;
}
if (length(songSeconds) == 1) {
songSeconds = "0" + songSeconds;
}
songTime = songMinutes + ":" + songSeconds;
s.onSoundComplete = nextSong;
}
clockTime = new Date();
clockHours = clockTime.getHours();
clockMinutes = clockTime.getMinutes();
if (clockHours > 12) {
clockHours = clockHours - 12;
}
if (length(clockMinutes) == 1) {
clockMinutes = "0" + clockMinutes;
}
clockTime2 = clockHours + ":" + clockMinutes;
}
Any one as an ideia on why is this failing.
the Output says this:
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 21: Operator '=' must be followed by an operand
);
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 22: ')' or ',' expected
songDesc = new Array (
Any ideia???
Actionscript Failing On Publish
hello,
when i publish my file, the actionscript dies although it worked ok in the 'test movie' screen... is this a common problem?
once published, i lost all my goto random frame programming, all my dynamic text field boxes, and when from inside a mc i told it to setproperty invisible, it stayed visible and went to the left for some reason. please can you help me?
leila
Variable Logic Is Failing...
I have an script assigned to the first frame of my movie. The movie is receiving a variable passed to it in the loaded URL in the format of "navflash.swf?RegionID=X" where X is from 1-8. The script I have been using is below.
**********************************************
stop();
if (RegionID == 1) {
gotoAndPlay(11);
} else if (RegionID == 2) {
gotoAndPlay(31);
} else if (RegionID == 3) {
gotoAndPlay(51);
} else if (RegionID == 4) {
gotoAndPlay(71);
} else if (RegionID == 5) {
gotoAndPlay(91);
} else if (RegionID == 6) {
gotoAndPlay(111);
} else if (RegionID == 7) {
gotoAndPlay(131);
} else if (RegionID == 8) {
gotoAndPlay(151);
}
**********************************************
I'm certain that the variable is being passed correctly, as I have created a debug variable text field in the movie itself to display the RegionID variable. It shows the number 1-8 as I pass the different values.
The strange result that I am getting is that if the passed variable is between 1 and 8 the script jumps to frame 11. If I pass it anything ouside of the 1-8 range, it hits the default and stops at Frame 1 (like I expect it to...) For some reason, the script evaluates true for the first IF statement on any number from 1-8. Can anybody see errors is my script that would cause this?
Thanks for the help,
-Pete
The Stop(); Command Is Failing Help Me Plz
I have a keyframe with the stop(); command on it. It is the final frame of my .fla. It has a button that plays it from the beginning again, but just some static text. However, after a couple seconds, it loops back to the beginning on its own. Why would it do that? How can I stop it? Thanks.
Smaug
Please Assist With Failing Links
Sorry for such a newbie question, but here goes...
I have made a movie clip symbol (called "Links") which is the collection of links for a site. Then, I placed the "Links" symbol on the main document area in Scene 1. Some of the buttons in "Links" point to external URLs, and those work fine. But other buttons within the same clip-symbol point to different frame locations in the Scene1 timeline.
What I did was -- I went into the "Links" movie clip symbol, and entered the following action command for some of the links:
on (release) {
gotoAndPlay ("Scene1", 35);
}
So, if I place a button on the main timeline for Scene1 and give it this command, it works fine (it jumps to frame 35, as it should), but...if I place a button in a separate movie clip symbol ("Links") with this action, and then place THAT symbol into the timeline for Scene1, the link does not work.
Can someone please explain what I need to do to get this command to work from within the clip-symbol? I would appreciate anyone's help.
Thanks!
John
Failing:if ((Key.isDown(Key.SHIFT && Key.RIGHT))) {
How to hold SHIFT and one time pressing RIGHT arrow key. only then MC moves 20px to the right. I tried
PHP Code:
if ((Key.isDown(Key.SHIFT + Key.RIGHT))) {
if ((Key.isDown(Key.SHIFT && Key.RIGHT))) {
in vain (the MC don't move using above methods).
this is my working script:
// moving buttonMenu by arrow keys
moveit = 10;
submit_button.addEventListener("click", submitListener);
_root.buttonmenu_mc.onEnterFrame = function() {
//trace("buttonMenu onEnterFrame");
if ((Key.isDown(Key.SHIFT && Key.RIGHT))) {
this._x += moveit;
} else if ((Key.isDown(Key.LEFT))) {
this._x -= moveit;
}
if ((Key.isDown(Key.DOWN))) {
this._y += moveit;
} else if ((Key.isDown(Key.UP))) {
this._y -= moveit;
}
};
i saw several tutorials: http://www.flashkit.com/tutorials/Ac...1088/more2.php
http://www.flashkit.com/tutorials/Ac...1150/index.php
http://www.metamorphozis.com/tutoria...tutorial.shtml
[F8] Falling Hittest Failing
Hi,
Im trying to create a simple game where objects randomly fall from the top of the screen and are caught by an object at the bottom, but im having trouble with my hittest.
Attached to the catching object ive placed the following code:
onClipEvent (enterFrame) {
if (_root.circle, hitTest(_root.ani_clip)) {
_root.text = "Collision Detected";
} else {
_root.text = "No Collision";
}
}
and attched to my falling movie clip is:
AT FRAME 1:
function start_play(clip)
{
rectw = 550;
recth = 400;
xpos = random(rectw-20) + 10;
setProperty(clip, _x, xpos);
clip.gotoAndPlay(3);
}
threshold = 25;
num = random(30);
if(num > threshold) {
start_play(this);
}
AT FRAME TWO:
gotoAndPlay(1);
AND ON THE MAIN STAGE ON FRAME ONE:
for(i=1; i<3; i++) {
duplicateMovieClip("ani_clip", "ani_clip" + i, i);
}
It works but only for the first of the three repeated falls of the movie clip. Can anyone tell me where im going wrong or have i got the wrong end of the stick? Im trying to create this:
www.ferryhalim.com/orisinal/g2/applegame.htm
Here's my fla file if anyone is a bit confused!
Thanks, Bobby
A Simple GotoAndStop Is Failing Me.
Can someone please look at my swf file and tell me why the One Player button doesn't change to the second frame of the scene when clicked. I have tried so many different things and nothing seems to work.
http://www.ethland.com/Bunny's Quest 2.fla
EDIT: Fixed the link and forgot to add that I am using Flash Professional 8.
[F8] Agorith For Maping Is Failing
hi i am newb in flash
but not in c++ and php so i basicaly know the universal code
so i made a agorithm for msn live virtual earth everything works unil i inputed zero at the beginning it spits a undefined and it messes the equation i have tried to set special catchers but they are not working i cant find what the problem is.
what the agorithim is trying to do is
At zoom level 1, the Earth is divided into 4 tiles numbered 0 to 3 thus:
These tiles are delivered from 4 separate servers, using the following URLs
http://r0.ortho.tiles.virtualearth.net/tiles/r"0".png?g=1
http://r1.ortho.tiles.virtualearth.net/tiles/r1.png?g=1
http://r2.ortho.tiles.virtualearth.net/tiles/r2.png?g=1
http://r3.ortho.tiles.virtualearth.net/tiles/r3.png?g=1
As you zoom in, the tiles are further subdivided, so when you move to zoom level 2, the upper right quarter divides into four tiles 10, 11, 12 and 13.
This indexing system continues recursively, allowing the earth's surface to be broken up into a grid, with each square represented by a number which we'll refer to as its quad key.
As you can see, server r0 always delivers top left squares, server r1 top right and so on. The significance of the "r" is road – other designators include "a" for aerial and "h" for hybrid. Aerial and hybrid images are delivered from a different set of tile servers.
if you need more information on the article http://www.viavirtualearth.com/vve/A...ileServer.ashx
so basicaly if the number was
1114
the four is over 3
so the number
is
1120
that is how the agorithm works
but if the number outputed
0333
or somthing with a zero at the bottom
the agorithm spits out undefined
in this case of 0333
i wanted the agorithm to spit out 0333 and not undefined because
the number the agorithm spits out goes to this url and in another section of the code that is not stated then output a picture in flash.
for example http://r3.ortho.tiles.virtualearth.n.../r0333.png?g=1 if you click on the url it outputs a picture
here is the source code it will work with just copying it to a blank fla file in flash 8
Quote:
function convert(mapnum:String) {
trace("startnum"+mapnum)
var my_str:String = String(mapnum);
var my_array:Array = my_str.split("");
var length:Number=my_array.length;
var whilenum:Number = 1;
var sudo:Number = 0;
for (var z = 0; z < my_array.length; z++){
for (var i = 0; i<my_array.length; i++) {
trace("i="+i)
trace("num="+my_array[i])
var digit:Number;
digit = my_array.length - i;
if(my_array[i]>= 4)
{
var full:Number =10;
var lastdigit:Number = Number(my_array[i]);
lastdigit = lastdigit - 4;
if(lastdigit == 1)
{
lastdigit=0;
}
if (lastdigit ==2)
{
lastdigit = 1;
}
if (lastdigit == 3)
{
lastdigit =2;
}
if (lastdigit == 4)
{
lastdigit =3;
}
digit = digit -1;
for(var b =1; b < digit; b++)
{
full =10 * full;
}
my_array[i] = full + lastdigit;
full = 10;
}
if(my_array[i]== 4)
{
var full:Number =10;
digit = digit -1;
for(var b =0; b < digit; b++)
{
full =10 * full;
}
my_array[i] = full;
full = 10;
}
else
{
var regular:String = "0";
if( my_array[i] == 0)
{if(i == 0)
{
sudo = 1;
}else{
digit =digit - 1;
for(var d =0; d < digit; d++)
{
regular =regular + 0;
}
my_array[i] = regular;
}}
else{
for(var b =1; b < digit; b++)
{
my_array[i] = my_array[i] * 10;
}
}
}
}
var final:Number = 0;
for( var c = 0; c < my_array.length; c++)
{
final = final + Number(my_array[c]);
}
trace("finalb="+final);
if(sudo==1)
{
if(z==2)
{
var my_str:String = String(final);
my_str = "0" + my_str;
trace("sudo:"+ my_str);
var final:String = mystr;
trace(final);
}}
trace("final="+ final)
var my_str:String = String(final);
var my_array:Array = my_str.split("");
}
return final;
}
trace(convert("014"));
i am sorry administrators for the size
i have been trying to figure this out for the past 5 hours and i cant figure it out
thank you in advance
and sombody please help me
[CS3] Computespectrum Failing Randomly
Hi..
am trying to make a mp3 player by using actionscript3.
In this , am trying a upload a mp3 file and play that particular file. Am also using the computespectrum() to display the graphics.
Now the problem am facing is with the computespectrum . Randomly , the computespectrum is failing for the same file and is throwing error.The error is as follows
SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: http://site.com/FileUploader/mp3player.swf cannot access . This may be worked around by calling Security.allowDomain.
at flash.media::SoundMixer$/computeSpectrum()
Am actually uploading the file into a folder named "mp3files". The "mp3files" folder and the swf are lying in the same domain.
Has anyone got an error like this before.. Pl help me.. Am really stuck with this...
Computespectrum Failing Randomly
Hi..
am trying to make a mp3 player by using actionscript3.
In this , am trying a upload a mp3 file and play that particular file. Am also using the computespectrum() to display the graphics.
Now the problem am facing is with the computespectrum . Randomly , the computespectrum is failing for the same file and is throwing error.The error is as follows
SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: http://site.com/FileUploader/mp3player.swf cannot access . This may be worked around by calling Security.allowDomain.
at flash.media::SoundMixer$/computeSpectrum()
Am actually uploading the file into a folder named "mp3files". The "mp3files" folder and the swf are lying in the same domain.
Has anyone got an error like this before.. Pl help me.. Am really stuck with this...
[CS3 AS2] Cross-domain PHP Failing
Hi all,
So I'm trying to call a php mail script from another server and it's not going through. I've set up my crossdomain.xml with the following:
Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
(Tried the wildcard after I couldn't get the specific site going).
My call is:
Code:
emailPHP.sendAndLoad('http://www.mysite.com/wwwFiles/olmail.php', resultEmail, "POST");
The only thing I'm thinking might be wrong is that my FTP access is set up using a port. I've dropped the crossdomain.xml in the root, but could the port be screwing things up at all? Or is it my sendandload call?
Randomly Failing LoadVars() ?
I have a product research questionnaire made in Flash that uses LoadVars() to send each response to a PHP script, which then stores the data in a database.
The problem is that sometimes I don't get the answer data from Flash (but I get the other data), so I am wondering why it might work sometimes and not others. I can't replicate the problem.
Any ideas?
As an example here is the code for A1, which uses 2 radio button components to set a yes / no answer.
Code:
// on the frame
var a1Listener:Object = new Object();
a1Listener.click = function (evt)
{
_root.a1_answers_final[0] = evt.target.selection.data;
}
a1.addEventListener("click", a1Listener);
// a1 is the group name for the radio buttons
Code:
// on the "Next" button
on(release)
{
if (_parent.setAnswers("a", 1, 1, 1, 0))
{
_parent.saveAnswer("a", 1);
this.nextFrame();
this.play();
}
else
{
_parent.alert("Please select an answer.", "");
}
}
Code:
function setAnswers(section:String, question:Number, required:Number, num_required:Number, doSet:Number)
{
var iterations:Number = _root["section_" + section].num_answers;
var numSelected:Number = 0;
for(var i:Number=1; i<= iterations; i++)
{
if (_root["section_" + section][section + question + "_" + i].selected == true)
{
numSelected++;
if (doSet == 1)
{
var answer:String = _root["section_" + section][section + question + "_answers"][i-1];
_root[section + question + "_answers_final"].push(answer);
}
}
}
if (required == 1 and numSelected < num_required)
{
_root[section+question+"_answers_final"] = Array();
return false;
}
else
{
return true;
}
}
Code:
function saveAnswer(section:String, question:Number)
{
this.save_progress._visible = true;
this.save_progress.dots.gotoAndPlay(1);
for (var i:String in _root.saveData)
{
if (i != "onLoad" and i != "code")
{
delete _root.saveData[i];
}
}
_root.saveData.qnum = section+question;
_root.saveData.answer = _root[section+question+"_answers_final"].toString();
_root.saveData.sendAndLoad(_root.saveDataScript, _root.saveData, "POST");
}
Thanks,
Computespectrum Failing Randomly
Hi..
am trying to make a mp3 player by using actionscript3.
In this , am trying a upload a mp3 file and play that particular file. Am also using the computespectrum() to display the graphics.
Now the problem am facing is with the computespectrum . Randomly , the computespectrum is failing for the same file and is throwing error.The error is as follows
SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: http://site.com/FileUploader/mp3player.swf cannot access . This may be worked around by calling Security.allowDomain.
at flash.media::SoundMixer$/computeSpectrum()
Am actually uploading the file into a folder named "mp3files". The "mp3files" folder and the swf are lying in the same domain.
Has anyone got an error like this before.. Pl help me.. Am really stuck with this...
WordWrap Failing Strangely
Hi,
I seem to have a small problem with wordWrap in my text field I've never come across it before (which I find a bit bizarre) and it's driving me nuts: When using '
' or '
' or setting the field to html and using '<br>' the wrapping sometimes fails.
Here's an example.
For the purposes of demonstration the script I've used is:
(I've put in a few extra returns to stop the thread increasing the width of this page).
ActionScript Code:
myFormat = new TextFormat();
myFormat.font = "embeddedfont";
myFormat.size = 8;
_root.createTextField("myField", 0, 10,10, 250, 200);
_root.myField.embedFonts = true;
_root.myField.wordWrap = true;
_root.myField.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.
Integer condimentum mattis pede. Sed
mauris quam, consequat sit
amet,
pharetra ac, tempus in, quam. Nam scelerisque condimentum arcu.
Etiam eu quam. Integer sed tellus. Nulla pulvinar. Vestibulum metus.
Pellentesque sodales quam non libero. Mauris convallis metus ut arcu. In nec
magna nec dui congue pulvinar. Proin laoreet sollicitudin nulla. Aliquam erat
volutpat. Sed interdum. Integer feugiat consequat sem. Integer dui mauris,
iaculis at, adipiscing ut, nonummy et, pede. Ut id erat eget diam tincidunt
malesuada. Aenean rutrum enim in nibh. Aliquam consequat cursus lectus.
Aliquam mollis pulvinar erat. Phasellus sollicitudin congue mi. Nunc lacinia wisi
id ligula. Ut vestibulum, libero eu egestas eleifend, massa libero pretium erat,
vel luctus velit nulla non arcu. Curabitur ut wisi eget velit consequat tincidunt.
Maecenas dolor quam, malesuada et, sollicitudin et, molestie ac, quam.
Suspendisse ultrices, purus quis auctor suscipit, odio ante euismod tellus, in
pellentesque dui dui sed lorem. Ut id nisl. Etiam metus ante, pulvinar sit amet,
vulputate vitae, cursus vel, massa. Duis leo odio, auctor quis, blandit a,
suscipit vitae, felis. Nunc id leo eu neque pulvinar volutpat. Integer
pellentesque tellus vitae dolor. Aliquam tempor dictum neque. In venenatis,
nibh quis pharetra laoreet, neque urna commodo velit, et molestie diam tellus
a lorem. Phasellus ipsum lectus, tristique ac, dapibus in, convallis at, odio.
Donec ligula wisi, pellentesque a, placerat vitae, tincidunt in, est. Aenean
mauris orci, venenatis et, adipiscing nec, cursus et, urna. Sed mauris diam,
bibendum at, fermentum at, commodo sit amet.";
_root.myField.setTextFormat(myFormat);
_root.myField.border = true;
which works fine. If I then reduce the width of the text field as so:
ActionScript Code:
//etc.
_root.createTextField("myField", 0, 10,10, 243, 200);
_root.myField.embedFonts = true;
//etc.
it then fails to wrap. If I then set embedded fonts to false:
ActionScript Code:
//etc.
_root.createTextField("myField", 0, 10,10, 243, 200);
_root.myField.embedFonts = false;
//etc.
It works again. I thought there may be a problem with the font so I tried it with a couple of others. The effect is still there, but the widths at which the word wrap fails varies.
Has anyone come across this before and what do I do about it? Any thoughts gratefully recieved.
cheers.
Adobe 9 Failing To Instal
Everytime I try to download Adobe 9 Flash Player it starts to download and then seems to just stop and go back to the downloading page online. Wondering why it will not install?
Button Controls Failing
I am trying to raise and lower several windows using rollover buttons. I need it to raise on rollover and lower on release. I can get it to do one but not the other. can you help me out with the formating to get this to work properly? It's driving me insave! here is the start to my code.
onClipEvent (load) {
_x=0;
_y=0;
speed = 10;
}
onClipEvent(enterFrame) {
_x+=(endX-_x)/speed;
_y+=(endY-_y)/speed;
_root.selections1.multifunction.onRollOver= function (){
endX=0;
endY=372;
}
}
selections1 is my button and multifunction is my window movieclip
FileReference.download Failing
I'm trying to use FileReference.download for a user to download a file. (obviously)
It's working just fine, for probably 99% of our users. However, for one user in particular, the "Save As..." dialog box never appears. Does anybody know of any firewall/anit-virus/other security settings that could block this? It's happening in FF 2.0 and IE 6, with Flash Player 9.
Filters Failing With 'loadMovie'
I am loading a swf with 'loadMovie' however every attempt to apply a filter to this swf fails. The action script below works until the moment I 'loadMovie.'
import flash.filters.BlurFilter;
var myBlurFilter = new BlurFilter(20, 20, 3);
blueprints_bonusFeatures.filters = [myBlurFilter];
loadMovie("blueprints_bonusFeatures.swf", blueprints_bonusFeatures.blankMovieClip);
I am publishing both files at:
Flash Player 9, Actions Script 2.0
I appreciate your help, thank you.
-D.Reed
Edited: 09/12/2007 at 11:49:41 AM by D.Reed
LoadMovie() Failing For Unicodepath
Hi,
I am trying to load a swf file (𠘨𠘑ã‚ãªã¾ã‚‰.swf) on my disk using following ActionScript:::
on(release)
{
loadMovie("u2E87ud841ude11u3042u306Au307Eu3089.swf", "_level1");
}
Now my swf is not loaded. Any help?
Other observation:
If I remove the surrogate pair character from the path and loadMovie method still the character (𠘨, u2E87)
which is below 0xFFFF creates problem.
I would like to know the method to make the unicode files load using loadMovie() API.
Flash To MySQL Using PHP Failing?
HI guys
I seem to have a little issue this flash calling PHP files.
I simply want to have an input box in my flash file send a new email address to a subscription page.
The php page works if called independently. But it fails to work from flash?
I am not even trying to use input boxes now just get it to call the damn thing!
flash button is
ActionScript Code:
on (release) { form.loadVariables("email.php", "POST");}
email .php --
Code:
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("techbe_email", $con);
mysql_query("insert into email_list_subscribers (listid,emailaddress,format)VALUES ('4','test10@php.com','h')");
mysql_close($con);
thanks for any help!?
Extreme Noob Trying His Best And Failing
Hello all,
I'm very new to the actionscript scene and have purchased the macromedia flash bible, and have read it (ish). Anywho I have made a basic 1 track mp3 player for my site but as its audio its large and hence takes a while to download. My problem is how ever I want to make a loading bar that travels depending on the bytes loaded and is replaced by the media player on completion of the load.
I have made an attempt but for some reason the loading bar doesn't appear until the movie clip is about 90% loaded. I need one that appears quickly. I've spent weeks tredging through forums and books but can't seem to get it nailed. I've come close many times.
The player is saved as a .swf obviously.
I would appreciate any help you guys could offer!
thanks in advance
Slapgravel
Login System Keeps Failing
me again, near to solving my login problem using the load var method.
have a movie with one layer and one keyframe.
on the keyframe is
two input fields with instance names of 'uname' and 'pword'. a dynamic text box with instance name of 'status_text' and a button with instance name 'go_btn'
using the below scripts, when a username/password combination is entered, and the button is pressed, the process begins and the message is successfully displayed in the 'status_text' box.
however, only the 'Login Failed' message is being displayed, even if i enter correct database information. anyone know why?
my 'actions' for keyframe 1:
stop();
function doLogin() {
status_text.text = "Starting function";
sendVars = new LoadVars();
sendVars.uname = _root.uname.text;
sendVars.pword = _root.pword.text;
sendVars.onLoad = function(success){
if(success){
if(sendVars.answer == "ok"){
status_text.text = "Login Successful";
}else{
status_text.text = "Login Failed";
}
}
}
sendVars.sendAndLoad("http://k.1asphost.com/login.asp",sendVars,"POST");
}
_root.go_btn.onRelease = doLogin;
and my login.asp as this:
<%
Dim strUsername
Dim Pwd
'strUsername = Request.form("uname")
'Pwd = Request.form("pword")
'for my troubleshooting.
strUsername = "jimmy"
Pwd = "jimmy"
MyPath=Server.MapPath("database.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & MyPath
query = "SELECT * FROM users WHERE username='"& strUsername &"' AND password='"& Pwd &"'"
set rs = conn.Execute (query)
'Check if the user and password are valid
if rs.eof then
'There is no record to match the UserName and Password redirect user to fail page
response.write("&answer=failed")
else
' Set up session variables use Sessions only if you wish to check for authorized users only in other pages
Session("member") = rs("Id")
Session.Timeout = 20 'Set Session Inactivity to 20 minutes
'redirect authorized user to main page
response.write("&answer=ok")
end if
'close recordset
rs.close
'Reclaim system resources before redirection
set conn = nothing
set rs = nothing
%>
anything fishy going on that a new fish like me wouldnt notice...?
Actionscript Failing In My Scrollbar
Hello. I'm making a very small and simple flash website and have made a scrollbar which works almost perfectly. When manually selecting the 'scrollbox' and moving it up and down it stops exactly at the top and bottom of the scrolltrack. the 'up' arrow also works perfectly but when pressing the 'down' arrow the scrollbox always over-shoots the end of the scrolltrack. Here is the link to what I've made so far so anyone can see for themself:
www.pitzundpartner.de/flash/kubiq.html
There is a lot of actionscript involved both in the main stage and in each component of the scrollbar so for now i wont post all the script. If it's impossible to work out whats going wrong without seeing the actionscript then please let me know and i'll go ahead and post it. Thanks very much to anyone who can be of assistance.
Jamie
TextField.wordWrap Failing
I'm having a strange problem where the wordWrap property of the TextField object only works if I create the TextField object via code.
If I use the GUI to make the TextField (assigning it dynamic type and naming an instance), it doesnt wrap. I can, however, set the text of the GUI created TextField fine.
The data that is getting displayed in the TextField is from an XML feed. So OnLoad() of the XML file I try to set:
_root.text1.wordWrap = true;
_root.text1.text = myvalue;
This correctly sets the text property, but the wordWrap property is ignored.
If I do:
createTextField("text1",0,0,60,60);
text1.wordWrap = true;
text1.text = myvalue;
Everything works as expected.
I dont understand why I have to code the textfield creation. Any info would be appreciated.
thanks
John
LoadMovie + Failing Preload = Stress
So I have a movieclip called content on my main stage, and when a button is clicked I call _root.content.loadMovie("whatever.swf") to load some content into it. Now, some of this content is big, so I wanted to have a preloader. I have a working preloader, so I just put it in the first scene of the swf that I'm loading. When I preview these content swf's individually, the preloader works fine, but it doesn't work at all when i load it with the actionscript call. Does anyone know why this happens, and more importantly how I can fix it? Thanks in advance.
-Mike
Trying To Create Instances Of Movieclip On The Fly (and Failing)
Hi,
I'm trying to create instances of a movieclip stored in the library called 'menu_mc' using AS, but nothing is appearing on the stage in the x,y positions I specify.
Can anyone point out where I'm going wrong?
Here's my pseudo code:
z = _root.getNextHighestDepth();
duplicateMovieClip(_root.menu_mc, "menu_"+gcount, z)
_root["menu_"+gcount]._x = 100;
_root["menu_"+gcount]._y = 100;
thanks!
rich
Simple XMLSocket Connection Failing
Code:
mySock = new XMLSocket();
mySock.connect("61.14.187.197", 5555);
mySock.onConnect = function(success:Boolean) {
if(success) {
output = "Connected";
} else {
output = "Failed";
}
}
This is the code that isnt working. I don't know why, it seems perfect to me. I've uploaded it to the main directory of my server, apdistributors.net/xmlsocket.swf, yet it still returns that it's failed. If anyone could help that would be great.
Ben.
|