Scrolling Headaches
Hi there all
Just wondering if anyone knows of a problem which causes flash to leave some pictures out of a scrolling clip?
Basically I have 15 images + the first 2 repeated after the last image in the row.
It seems that flash tends to not render the ones closest to the start and end, about 4 images..
The scroll script seems to be working fine as supplied and the total length of the slider MC is: 5232 px.
Does flash have limits on this or could it be a memory thing?
Any help gladly appreciated, thanks heaps in advance!!
-- -- Action in frame 1:
_root.slider._x = _root.slider._x+1; // when mouse moves left, navigation panel moves right if ((_xmouse>600) && (_xmouse<625) && (_ymouse>329) && (_ymouse<354)) { _root.slider._x = _root.slider._x+10; } // when mouse moves right, navigation panel moves left if ((_xmouse>120) && (_xmouse<145) && (_ymouse>329) && (_ymouse<354)) { _root.slider._x = _root.slider._x-10; } // when navigation panel reaches it's maximum x-value it resets itself if (_root.slider._x > 2500) { _root.slider._x = -878; } if (_root.slider._x < -878) { _root.slider._x = 2500; }
-- -- Action in frame 2:
gotoAndPlay ("currentframe", -1); -- --
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-19-2002, 03:13 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
LoadMovie Headaches
Please help me.....
Ok, I'm loading external swfs into a placeholder movie clip with a button. Below is the code:
on (release) {
loadMovie("flash/w1.swf", "content");
}
For some reason, on a PC & a Mac, the preloader flickers and never appears, and the button must be clicked multiple times for the loadmovie command to work (sometimes it dosen't work at all).
I know the problem isn't the preloader, because I use the same exact code to preload the main movie!
HEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLPPPPPPPPPPPP!
CHeck out the site at http://www.kieran-evans.com
Goto the portfolio section.
Thanks!
SwapDepths( ) Headaches
I have a tab like menu where "folders" are attached to "tabs" that can be selected and pulled out individually or one on top of the other using swapDepths. For simplicity, I'd like to just get 2 tabs to work for now.
heres a pseudo-code summary:
in _root.main_mc I have 2 tab_mc instances called
tab1
tab2
Each has embedded code to "attachMovie" to load 2 different mc's (the folders) from the library. (both are assigned the name "clip1")
in tab1: this.attachMovie("FolderClip1","clip1",1);
in tab2: this.attachMovie("FolderClip2","clip1",2);
other than that tab1 and tab2 are pretty much identical.
Both have button that controls weather the "tabs" are pulled out or pushed in.
I have a function that gets called when a tab gets "pulled out" and when it gets "pushed back".
The tab that has been called to be pulled out must go on top so it calls the a function (code simplified due to laziness)
CALL:
if(this.tabNumber == 1){
this.putOver(this._parent.tab2.clip1);}
the putUnder funtion is called the same way
-----------------------------------------
function putUnder(overTab) {
this.clip1.swapDepths(0);
putUnder.clip1.swapDepths(1000);
}
function putOver(underTab) {
if(this.clip1.getDepth() < underTab.clip1.getDepth())
{
trace(this + " at depth " + this.clip1.getDepth() + " needs to go on top");
trace(underTab + " at depth " + underTab.clip1.getDepth() + " needs to go on bottom");
trace("Swapping Depths!??");
this.clip1.swapDepths(1000);
underTab.clip1.swapDepths(0);
trace("On top is " + this + " at depth " + this.clip1.getDepth());
trace("On bottom is " + underTab + " at depth " underTab.clip1.getDepth());
}
}
_____________________________
It all works fine unless
- both tabs are closed
- tab2 is opened
- then tab1 is opened
The result is that tab1 pulls out UNDER tab2 even though the trace says:
_____________________________
_level0.main_mc.tab1 at depth 0 needs to go on top
_level0.main_mc.tab2 at depth 1000 needs to go on botton
Swapping Depths!??
On top is _level0.main_mctab1 at depth 1000
On bottom is _level0,main_mc.tab2 at depth 0
_____________________________
This is my first time trying swapDepths so I'm probably WAY off here.
Go and ideas?
Preload Headaches
Please help me with this preloader problem.
Here's the deal: I have 5 buttons on my home page. Each button when clicked, goes to (loads) a new frame in another movie clip (call it "ClipsMC")on the stage (the same movie clip for each button - ClipsMC, just a different frame within it - one of five frames). On each of these 5 frames, there is a photo that loads, as well as a NEW movie clip that plays on top of that photo (let's say "Frame1MC, Frame2MC, etc.).
Trouble I'm having is making a preloader for each of these movie clips (Frame1MC, etc.) appear - the preloader doesn't appear. I've tried putting the preloader inside the Frame1MC as well as on frame 1 in the ClipsMC, to no avail.
How can I get the preloader to show up? Anyone?
Multiple Headaches
hi everyone...
i just want to first thank you all for all the patience with me and for being soooo amazingly helpful.
i have a fla attached that shows my problems...
the first is that i am trying to load this movie clip... and at the same time, i want everything else to disappear... you see, when i load the movie clip, it loads on top of things...the other problem, is that the mc does not go to the middle of the stage...
i already tried this code:
onClipEvent(load){
// Set stage size here
stage_width=800;
stage_height=600;
w_middle=(stage_width/2)-this._width/2;
h_middle=(stage_height/2)-this._height/3;
this._x=w_middle;
this._y=h_middle;
}
but does not work...
what do i do??
Navigating Headaches
The problem is when I go to click on a link, as you can see by the names of each link, the clicked link is taking me to the link directly below it.
What the %#&*%@...I have no idea what's going on.
For instance, when I click on the "Imaging & Coding" link, it takes me to "Automated Data Extraction" (as you can see by the page identifier in the sliding content window).
help
-Matthew
www.geekless.com/pd/index.html <-----this is the link for the project
www.geekless.com/pd/index.swf
www.geekless.com/pd/index.fla
Loading Headaches
Me again
please take a look at:
www.lynx.ch/hw/menu.html
Reacting to the buttons its an MC. If you click Portofolio and get there you will see that a external swf its playing. But this is loading in the moment the main file its opened. What I want to achieve is that the external file loads just in the moment the portofolio button its pushed. The same for the other sections. When I push the links button another external file it is loaded.
the script to which the buttons react is
ButtonPortofolio.onRelease = function() {
FrontMC.easeMe(348, undefined, 10);
backMC.easeme(400, undefined, 15);
If anybody has an advise, please let me know
Thanks
__________________
-------------------------------
Mai presus
De mariri, de caderi, de cuvant
Preloaders.... Headaches...
hi,
here is my movie structure...
_root.main.contcon.shopcon
some little swf's are loaded into that "shopcon" MC. and i want a preloader that shows the loading process... sometimes i can achieve this. but alas, this time things got harder. and my preloader does not seem to work, why?...
maybe i should embed the preloader into each swf that is going to be preloaded. i tried that too. but i think somethin wrong with the AS.
is there any simple(maybe the simplest) preloader that you may recommend? i'm stuck.
thanx to all...
that's the preloader AS that is embedded in the swf that's goin to be loaded. but no luck.
Code:
total = int(_root.main.contcon.shopcon.getBytesTotal()/1024);
download = int(_root.main.contcon.shopcon.getBytesLoaded()/1024);
if (total == download) {
tellTarget ("_root.main.contcon.shopcon") {
play();
}
} else {
gotoAndPlay(3);
}
OnMouseOver Headaches
Peps ~ I created a scene with Buttons. There are 8 Buttons representing 8 different Cities. (Red/Green) When you [RollOver] the Red Button, it shld turn to Green and advance to another Frame. If you [RollOut], it shld return to its' Starting Point, however if when on the Green Button, if you [Press], you shld move up another Frame and a Graphic Display will show.
Upon [RollOut] it shld again take you back to the Starting Point [Frame 1]. On the first button, it works like a charm but none of the other ones work at all. I inspected the Movie Explorer and noticed that there are far too many Action Scipts going on and I can't tell which one is making this thing work. I did a Screen Capture on my Script if and if you'd like 2C what I have going on, I will Post it.
I created an original set of Buttons and didn't like them so I created a new set of Buttons and although I don't see them in my Movie Scene, I think the Script that was written at the time is still in the Legend, so I'm afraid to Delete anything because I don't know which would be safe.
Would Someone like 2C these Scripts and C if htye can figure out which script is making this action work and which scripts R just taking up space?
Thanks -
Sound Headaches
I have 3 machines here and 1 of them is giving me quite the headache.
The machine acting up is a new G5 box - clean install, with only Flash 2004 MX Professional installed.
When I pull up any flash content on this machine, there is absolutly no sound. The other 2 machines are able to play the files and hear music perfectly (one is a Mac, and the other a PC.)
If I go into a .fla file and attempt to play a sound in the Library, nothing happens - no error, and certainly no sound. I can publish the file, and the other 2 machines hear the sound fine. Sound works absolutely fine in every other application - just to complicate things further. I've also reinstalled Flash and that made absolutely no difference.
Anyone have an ideas?
Thanks!
Joomla Headaches
Hi everyone,
I am using Joomla as a CMS, and I want to incorporate a flash video gallery with a thumbnail scroller into the site. When I load the page, all I get is the staged player (playing nothing) and no thumbnail scroller. Is there anyone out there that has tried this and is there a solution to the problem?
Any help would be greatly appreciated.
Thanks !
GotoAndPlay Headaches
Hi
I'm trying to control on movie clip with another. Both movie clips are on _root. In the controlling movie clip I'm using _root.cracker.gotoAndPlay(9). It appears as though the play head is moving to this frame but the movie does not continue to play. Any ideas? thanks
Preloader Headaches
Ok..does anyone have any clue why my preloader would get stuck on 11%? Here is the actionscript:
var nowLoaded = _root._framesloaded;
var totalLoaded = _root._totalframes;
if (nowLoaded == totalLoaded) {
gotoAndPlay("Scene 1", 1);
}
bytesIn = _root.getBytesLoaded();
bytesAll = _root.getBytesTotal();
percent = Math.floor((bytesIn/bytesAll)*100);
_root.chart._xscale = percent;
_root.load.autoSize = true;
_root.load.text = percent+"%";
Then in the second frame:
gotoAndPlay(1);
It works fine until it gets to 11% everytime it freezes...but if I right click on the movie and hit "play" the movie is loaded and ready to go. So I know it keeps loading when its reading 11%.
I hate preloaders!!
LoadMovie Headaches...Help
Ok I'm using the following loadMovie script to load flash movies onto my website.
ActionScript Code:
on (release) { _root.contents.loadMovie("mymovie.swf");}
So the script works perfectly. It's a platformer game( 550 x 400) I'm trying to load. Now here's the wierd part. It loads in fine, but the AS gets all messed up. My guy dissapears( well I briefly see him fall through the platforms, so obviously the AS is off) and basically nothing is functional. If I play it from my desktop or from the game fla. It works beautifully. Then there's another movie(300 x 300) when I load it in there's no background! Flash just takes away the bg of my movie and leaves me with text and buttons. The AS appears to be messed up with this one as well. Does anyone know the answer to this strange problem? Any help would be greatly appreciated. Thanks in advance
Browser Headaches
Hi there,
I have just spent considerable time developing a pretty neat site for my client, only to discover that it doent function properly in firefox and on a mac.
I was under the understanding that flash was cross browser compatible
can anyone enlighten me as to what exactly are the problems to watch out for, what functions dont work, etc
wouldnt it be nice if we had one browser,
jam
HitTest Headaches..
I am using this to detect the right and left side of an object:
if(right.hitTest(_x, _y, _root.ground)) {
// do stuff
}
I used this multiple time in other occasions, but for some gay reason, it isn't working. It's only working if I say:
if(right.hitTest(_root.ground)) {
// do stuff
}
But, as you most likely know, doing it this way will detect that blue outline around the MC. Does anyone have any other way to detect left and right sides of movie clips or have any idea how to solve this using hitTest? This is really pissing me off
LoadMovie Headaches...Help
Ok I'm using the following loadMovie script to load flash movies onto my website.
ActionScript Code:
on (release) { _root.contents.loadMovie("mymovie.swf");}
So the script works perfectly. It's a platformer game( 550 x 400) I'm trying to load. Now here's the wierd part. It loads in fine, but the AS gets all messed up. My guy dissapears( well I briefly see him fall through the platforms, so obviously the AS is off) and basically nothing is functional. If I play it from my desktop or from the game fla. It works beautifully. Then there's another movie(300 x 300) when I load it in there's no background! Flash just takes away the bg of my movie and leaves me with text and buttons. The AS appears to be messed up with this one as well. Does anyone know the answer to this strange problem? Any help would be greatly appreciated. Thanks in advance
Bitmap Headaches
I am loading in an swf that contains a bitmap (png) and it comes in looking really bad. If I open the swf on its own or in a browser it looks really nice. Its just when it is loaded via LoadMovie that it looks less than good. Is there any way to fix this in MX ??
Preloading Problems (HEADACHES)
I'm having a problem where I'm trying to preload a movie that has a movie clip in it, and this movie clip is a gallery of pictures.
The preloader appears BUT it is delayed, It starts at about 21%
I've tried everything, different scenes.....and who knows what else.
any help please :-)
More Scrollpane Headaches (MX Pro 2004)
'Ello again.
I've moved on a bit from where I git stuck yesterday, but have found a new problem. I'm still using a scrollpane to load in a page of a magazine, but now I have them saved in a seperate directory as .swf files. The scrollpane is supposed to load them in when the user clicks a button.
The problem is, the scrollpane a) doesn't display the scrollbars, and b) is stretching the content proportionally to the resizing of the original component's size.
Anyone know what's going on? Cos I sure don't.
Newbie Scope Headaches
This code exists on frame one, which attaches an mc with a datagrid component and fills it with some numbers:
ActionScript Code:
var test:Tester = new Tester();
this.attachMovie("Tester_MC", "testerMC", 2, {_y:100, _x:100});
function makeBox():Void {
this.attachMovie("LstHolder_MC", "lstHolder_MC", 42, {_y:300, _x:100});
//trace("hello");
}
function fillGrid():Void {
for (var i = 0; i<10; i++) {
_level0.primary_mc.lstHolder_MC.lst.addItem(Math.random().toString());
}
trace("hello2");
}
and then on a button, on the stage is this:
ActionScript Code:
on (release) {
_level0.testerMC.makeBox();
_level0.testerMC.fillGrid();
}
That works just peachy.
However, in my class, I have the same thing called from some buttons that are intantiated in the movie:
ActionScript Code:
private function doAction():Void {
moveColorUp();
moveNavTwo();
_parent.secondState = 1;
_level0.testerMC.makeBox();
_level0.testerMC.fillGrid();
}
The mc appears on the stage but none of the numbers are getting inserted. The traces are showing up in the ouput box. It seems as though it should just work the same way as when the functions are called by the button on the stage.
I know I am using absolute paths to the mcs instead of relative, plus having these functions sit outside of the class. I got the same behavior with the functions inside the class and relative path addressing, so I set up this test. Just trying to figure out what the heck is happening.
What am I missing?
Thanks for any advice. This is driving me crazy.
Listener / Mc Scope Headaches
Scope will confuse me forever in flash. uploadBtn enable works in first and not in second... infact no mc scope works in the second one.
Please explain to me why this works:
listener.onSelect = function(selectedFile:FileReference):Void {
uploadBtn.enabled = false;
// Other stuff
}
And the scope vanishes here:-
listener.onIOError = function(file:FileReference):Void {
uploadBtn.enabled = true;
// Other stuff
}
Arrrghhhh! Help!
Dropdown Menu Headaches
Hello all,
I'm trying to create a dropdown menu that displays on MOUSE_DOWN and deactivates on MOUSE_UP or MOUSE_OUT.
Currently I've been going about it by adding buttons (menuButton) as children to the main button (mainButton) that creates the drop down menu, however MOUSE_OUT is firing on the edge of mainButton, and does not carry to any menuButton. I've read in a few places that ROLL_OUT carries to the children but this doesn't appear to act any differently in my case.
I've attempted to fix this by trying to add MovieClip layers to mainButton called TextLayer and ClickLayer, and then force the size of ClickLayer with a transparent rectangle to cover mainButton and any menuButton(s), however despite ClickLayer displaying ontop of TextLayer over the main-button, the new menuButton(s) of TextLayer that are created on MOUSE_DOWN display over the top of the section of ClickLayer that extends outside of the original main button.
Firstly, I'm confused, as I was under the influence that, as I'm adding ClickLayer AFTER TextLayer anything displayed within ClickLayer will display over the top of everything within TextLayer?
Secondly, I'm starting to feel that my problems with this drop-down menu are taking me down a path that is making this drop down menu much more complex than drop down menus should be?
So can anybody please explain how layering of MovieClips works, or a more appropriate way of developing this drop down menu?
Thanks
Error Opening URL HeadAches
Okay this is driving me nuts and not sure where to post it ..... Flash MX2004 wont open any URL's at localhost or even on the web, in the authoring enviroment ... anyone ever seen this happen ????? I can open the http://localhost/........ fine in a browser ..... but flash wont in the authoring enviroment.... it use too ... but not any more .. please help ... I have all ready reinstalled Flash ........ I'm not looking forward to reimaging my PC...... please help .....
More Memory Management Headaches
So,
I previously asked about some FLV files that I was loading externally, and having trouble with memory being released. Having sort of solved this, I am having the same problem with loading external resources and then getting them to be cleared out of memory when I'm done with them. I have seen kglad mention more than once that GC in flash 9.0.124.0 is broken, but where does that leave us? I have also tried my project in FP 10, and the memory still continues to go up and up. If I load an external resource - in this case I have a class that builds a VR room with papervision - and then close it, set it's instance to null, my memory never goes down. This is a total guess, but could it have anything to do with using Tweener in my project? Is there any way that the Tweener class could be keeping some of my objects in memory and keep them from being GC'd? I am using weak references in my listeners, setting any variable I can find to null... I can get over how frustrating this is to just see memory go up and up but find no reason. The class I am using also uses a few subclasses to build itself, but I end up with one instance of my VR on the stage. If I have set that instance to a name - myVR - and then removeChild(myVR) from the stage and set the name to null - that should do it right? Boy, this is frustrating.
- B
Datagrid Component Headaches.....
I'm trying to attach a movie clip to a cell in the datagrid... I'm using .cellRenderer to do it but the movie clip is showing up in every row... in that column.... even the empty rows that contain no data.....any way to get it to show up only in rows that have data ?
Angles, Searches And Headaches
Hi All,
I'm trying to search an array based on two angles. The array contains the LeftSideAngle and RightSideAngle. The search is entered in degrees, and there is a further field called variance, also in degrees. The idea being that you can then enter say 90°, with a variance of 90° and the search will return all matches with a LeftSideAngle>=45 and RightSideAngle<=135 (90° +- 90° on each side).
Now the problem comes when the LeftSideAngle>180, as the search will span the 360/0 point. E.g. Search = 0° and Variance = 270°, LeftSideAngle>=225 and RightSideAngle<=135. I've had a go at creating an if statement to handle it, but i'm admitting defeat! Here's what I've got:
Code:
if (LeftWallAngle>=180) {
if ((Unit.LeftWallAngle>=LeftWallAngle || Unit.LeftWallAngle<=RightWallAngle) && Unit.LeftWallAngle<=360 && Unit.LeftWallAngle>=0) {
leftTrue = true;
}
if (Unit.RightWallAngle>=LeftWallAngle && Unit.RightWallAngle<=360 && Unit.RightWallAngle>=0) {
rightTrue = true;
}
} else if (LeftWallAngle<=180) {
if (Unit.LeftWallAngle>=LeftWallAngle && Unit.LeftWallAngle<=RightWallAngle) {
leftTrue = true;
}
if (Unit.RightWallAngle>=LeftWallAngle && Unit.RightWallAngle<=RightWallAngle) {
rightTrue = true;
}
}
There's so many ifs it's got me lost! Any help is, as always, much appreciated!
Thanks!
Darren.
Datagrid Component Headaches.....
I'm trying to attach a movie clip to a cell in the datagrid... I'm using .cellRenderer to do it but the movie clip is showing up in every row... in that column.... even the empty rows that contain no data.....any way to get it to show up only in rows that have data ?
Video And Audio Headaches
Im trying to import a DV file (also converted to several other formats to see if it made any difference - didn't) into flash 2004 and it fails to import the audio track despite stating it will be embedded with the video. original is NOT a muxed track before we go that route. when i import as two different files they dont sync - audio finishing before video. orig file is 25fps and flash project is also 25fps, although i did start programming at 12 and then changed to 25, would this cause problems?
either way I still cant get the videoand audio to load together so anyone have any ideas?
thanks guys
kladze
Dynamic Text Box Headaches
I'm realtively new to Flash, but I'm not new to programming. That seems to make me rather dangerous since I am often putting together stuff that seems like it should work, but doesn't.
I am reading an XML file with a list of PDF files and some keywords. I have a movie clip I call pdfButton which has a dynamic text field and a simple mouse over event which hilites the clip as the mouse goes over. As I parse the XML file, I attach the pdfButton clip to the stage and set the dynamic text variable to be the title of the file.
So far so good. Now comes the problem. For some reason, the movie clips only behave properly when the font for the dynamic text field is embeded. IOW, the mouseover hilite works, they fade in and out with their container movie clip, and they respect the mask for the scrollpane that contains them.
However, the text looks really crappy with the font embedded. If I don't embed the font, the text looks nice and crisp, but none of the above work anymore.
Is there some secret to making dynamic text look good and still have it behave properly? Is there another way to implement this that will work better?
-Sean
Animations, Shape Tweens, Headaches.
Hi,
I'm creating an animation for my latest website. Its a robot walking towards the screen/user. I have created a shape tween that twists his torso as he walks, it has all the main lines but also a lot of shape-tween junk. I had hoped to break the tween into keyframes, then one by one cut out the shape-tween junk to leave the lines i want. But every time i do that my computer crashes bigstyle. Is there something i can do? i think i have too many shapehints on the tween (A-X), as it is very complicated. The only other thing i can think of is use the shape tween as a guide, and on a layer above draw over the tweened frames. I'll do it if i have to, but if theres another way...
Thanks.
Steven.
Anyone Have Huge Headaches Cause Of IE Update And Flash?
So i just deployed my new website design yesterday...
www.briandoakes.com
Thankfully I don't use flash that much... only for the home page photo splash.
So i deployed it yesterday everything was great and then today (after I updated microsoft) I kept getting that stupid tooltip to "Click Enter or Spacebar to activate" thing....
At first I thought the problem was on my end... till I saw that it worked find in FireFox.
Thankfully I was able to find the solution for it..
http://www.pixelmill.com/(dc3i91rvf1...cleID=kb101593
and fixed it rather quickly. But I only had one file to fix....
I am curious how this affected some of you more Flash Intensive designers and having to fix your sites? or did you just say skip it, and not bother recoding each page?
Shared Objects / Browser Headaches
I've created an audio player(swf) that is designed to populate on a dynamically created page multiple times (this means the one swf will occur/appear multipal times on the page).
A feature I'm attempting to add - and what I’m having trouble with - is my effort to prevent more than one player(swf) from playing at the same time; a simple enough concept (however, I've not seen it implimented in this mannner)
Example located here:
http://63.84.226.251/LSO/Player_w_test.html
Each instance of the player(swf) is being fed a unique URL (to content – mp3’s) via the FLASHVARS method of passing variables into a swf from the HTML document the swf is contained within. See below:
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="500" height="80" id="Player_w_test" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Player_w_test.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="url=song_01.m3u" />
<embed src="Player_w_test.swf" FlashVars="url=song_01.m3u" quality="high" bgcolor="#ffffff" width="500" height="80"
name="Player_w_test" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
I’m then storing this url as a unique variable in a Local Shared Object on the users machine.
code: //Establish variable = to URL imported via FLASHVARS
var nowPlaying = url;
//Establish SO to track activity
function soMeter (){
var so:SharedObject = SharedObject.getLocal( "soMeter", "/" );
so.data.currentState == undefined ? 0 : so.data.currentState;
so.data.currentState.clear;
so.data.currentState = nowPlaying; // Store URL as variable
so.data.currentState.flush; // Write/store SO value to user HD
trace(so.data.currentState);
_root.Broadcasting = so.data.currentState; // For testing only
}
This occurs only at the on(release) action of the players “play” button. Additionally, at the same time this on(release) action creates the Local Shared Object, it also executes a test function that loops. This test function takes the Local Shared Object value and stores it in a variable and then compares that variable to the value of the Local Shared Object written to the users’ machine.
code: // Stop clip if SO value changes
function test (){
var so:SharedObject = SharedObject.getLocal( "soMeter", "/" );
so.data.currentState == undefined ? 0 : so.data.currentState;
if(so.data.currentState != nowPlaying){
_level0.testClip.gotoAndStop(1);
_root.Receiving = so.data.currentState; // For testing only
_root.Broadcasting = "Not Sending"; // For testing only
stopSnd();
}
}
When the user selects a different player(swf) on the page the variable storing the initial LSO value (located in the first player(swf) selected) and the current value of the Local Shared object (assigned by the new player selected and written to the users machine) will no longer be equal to one another which will cause in the test function looping in the first player(swf) selected to execute a stop sound action that stops it’s player allowing the second player to keep playing uninterrupted.
(Note about test function: this test function is called as a frame action which has been placed in a looping MC. This was tested as an onEnterFrame loop but it did not allow the player to function properly – it stopped the both the first player selected (as intended) and the second player selected (not intended).
The player seems to test fine in IE6 (it operates with all functionality as intended)
The Problems I"m Experiencing are:
The function designed to prevent multipal playback does not operate with any reliability in Firefox and IE7. On some machines if works in IE7 but not Firefox. On other machines, if works in Firefox but not IE7. I'm baffeled and am wondering if others see it working correctly – and if so, what browser is being used?
I"m includeing the FLA:
The FLA included has an added feature for testing purposes only
2 dynamic text fields have been placed on the stage
1. (the first displays the value assigned to the Local Shared Object and Broadcast when the player is initially selected )
2. (the second displays the updated value of the Local Shared Object Received when the user makes a new selection)
I’m not at all sure why I"m experiencing difficullty in IE7 and Firefox.
Maybe it's the manner in which I"m testing the LSO.
If you have any words of wisdom, anything, I'd appreciate it.
RadioButton Component Giving Me Headaches
I'm trying to use a RadioButton in my Flash app and I'm getting a weird white box near it everytime I view with the RadioButtons in there, but if I take them out, there is no white box, so it has something to do with the component skins.
I went in to change the skins myself and I never saw any white box to edit or anything, so maybe it inherits some skin from some other component? not sure...also, the labels don't appear in the RadioButton until I roll over them? why is that? thanks in advance!
Custom Eventhandler Giving More Headaches
Hi all
I'm having huge difficulties getting my custom eventhandler to work. For some reason my eventhandler doesn't get triggered. My eventhandler should get triggered, when my form is submitted. Here is what I have got so far:
Custom event class called submitEvent.as:
Code:
package
{
import flash.events.Event;
public class submitEvent extends Event
{
public static const ON_FORM_SUBMIT:String = "onFormSubmit";
public function submitEvent(type:String)
{
super(type);
}
public override function clone():Event
{
return new submitEvent(type);
}
}
}
When form is submitted, dispatch event from submitForm class file:
Code:
dispatchEvent(new submitEvent(submitEvent.ON_FORM_SUBMIT));
Listener set up in document class file:
Code:
var emailSubmitform:submitForm = new submitForm();
emailSubmitform.addEventListener(submitEvent.ON_FORM_SUBMIT, onFormSubmit);
function onFormSubmit(e:submitEvent):void
{
trace("FORM IS SUBMITTED");
}
addChild(emailSubmitform);
Shared Objects / Browser Headaches
I've created an audio player(swf) that is designed to populate on a dynamically created page multiple times (this means the one swf will occur/appear multipal times on the page).
A feature I'm attempting to add - and what I’m having trouble with - is my effort to prevent more than one player(swf) from playing at the same time; a simple enough concept (however, I've not seen it implimented in this mannner)
Example located here:
http://63.84.226.251/LSO/Player_w_test.html
Each instance of the player(swf) is being fed a unique URL (to content – mp3’s) via the FLASHVARS method of passing variables into a swf from the HTML document the swf is contained within. See below:
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="80" id="Player_w_test" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Player_w_test.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="url=song_01.m3u" />
<embed src="Player_w_test.swf" FlashVars="url=song_01.m3u" quality="high" bgcolor="#ffffff" width="500" height="80" name="Player_w_test" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
I’m then storing this url as a unique variable in a Local Shared Object on the users machine.
ActionScript Code:
//Establish variable = to URL imported via FLASHVARS
var nowPlaying = url;
//Establish SO to track activity
function soMeter (){
var so:SharedObject = SharedObject.getLocal( "soMeter", "/" );
so.data.currentState == undefined ? 0 : so.data.currentState;
so.data.currentState.clear;
so.data.currentState = nowPlaying; // Store URL as variable
so.data.currentState.flush; // Write/store SO value to user HD
trace(so.data.currentState);
_root.Broadcasting = so.data.currentState; // For testing only
}
This occurs only at the on(release) action of the players “play” button. Additionally, at the same time this on(release) action creates the Local Shared Object, it also executes a test function that loops. This test function takes the Local Shared Object value and stores it in a variable and then compares that variable to the value of the Local Shared Object written to the users’ machine.
ActionScript Code:
// Stop clip if SO value changes
function test (){
var so:SharedObject = SharedObject.getLocal( "soMeter", "/" );
so.data.currentState == undefined ? 0 : so.data.currentState;
if(so.data.currentState != nowPlaying){
_level0.testClip.gotoAndStop(1);
_root.Receiving = so.data.currentState; // For testing only
_root.Broadcasting = "Not Sending"; // For testing only
stopSnd();
}
}
When the user selects a different player(swf) on the page the variable storing the initial LSO value (located in the first player(swf) selected) and the current value of the Local Shared object (assigned by the new player selected and written to the users machine) will no longer be equal to one another which will cause in the test function looping in the first player(swf) selected to execute a stop sound action that stops it’s player allowing the second player to keep playing uninterrupted.
(Note about test function: this test function is called as a frame action which has been placed in a looping MC. This was tested as an onEnterFrame loop but it did not allow the player to function properly – it stopped the both the first player selected (as intended) and the second player selected (not intended).
The player seems to test fine in IE6 (it operates with all functionality as intended)
The Problems I"m Experiencing are:
The function designed to prevent multipal playback does not operate with any reliability in Firefox and IE7. On some machines if works in IE7 but not Firefox. On other machines, if works in Firefox but not IE7. I'm baffeled and am wondering if others see it working correctly – and if so, what browser is being used?
I"m includeing the FLA:
The FLA included has an added feature for testing purposes only
2 dynamic text fields have been placed on the stage
1. (the first displays the value assigned to the Local Shared Object and Broadcast when the player is initially selected )
2. (the second displays the updated value of the Local Shared Object Received when the user makes a new selection)
I’m not at all sure why I"m experiencing difficullty in IE7 and Firefox.
Maybe it's the manner in which I"m testing the LSO.
If you have any words of wisdom, anything, I'd appreciate it.
Thanks!
Headaches With Sliding Menu Code
Well, hello all. This being my first post to this forum I thought I'd make it an easy one.
I'm trying to make a menu slide down at the top of my site. Here's what I've gotten it to do so far: http://www.chrishoare.ca/clientwork/...rosen/progress
Now the way I'm doing this is the entire menu is a movieclip (menuMC), and I have an onRollover/out statement that directs flash to play the rolldown/up animation inside menuMC, which also contains the buttons. Of course this doesnt work because the buttons are contained within the movieclip. How irritating.
So I had someone very nice at another forum direct me to code it thusly:
on the menuMC:
on (rollOver)
{
_root.dropdown = 1;
}
on a blank frame in the main timeline:
onEnterFrame = function()
{
if (_root.dropdown == 1)
{
_root.menuMC._y = _root.menuMC._y + (_root.menuMCnewposition - _root.menuMC._y)/_root.speed;
}
else
{
_root.menuMC._y = _root.menuMC._y + (_root.menuMColdPosition - _root.menuMC._y)/_root.speed;
}
}
Now I understand this is essentially looping the frame and waiting for mouseover to change _root.dropdown to "1" at which point the function will execute... but within the function itself, I dont understand how this will make my movie drop down in the fashion I want. Where is it that I am entering the co-ords for the movie to startfrom and goto? Also, since I still have the entire thing (menu buttons) contained within my movieclip (menuMC) ... won't they still not function as they are inside a movieclip - I was told thats the way flash is?
Can anybody direct me to a alternate way to accomplish this seemingly simple but alltogether frustrating task of smoothly sliding down and up a menu?
Thanks in advance for you reply.
Chris
Newbie With Sound Control With AS Headaches
Hello,
This is probably really easy to do, but I'm still new at scripting, so please be gentle ...
Here's what I'm trying to do:
When the main swf loads, welcome.mp3 plays once automatically.
On the timeline, I have a movie clip with an instance name of BGM_controls. Inside it are two buttons, stop_btn, and play_btn. The movie clip contains some simple tweening to allow the buttons to fade in or out. I use frame labels to control the animation.
When the movie begins and the music starts playing, stop_btn fades into view. On click, the music stops; stop_btn fades out from view; and play_btn appears. Then, when a user clicks play_btn, the music begins again; play_btn disappears and stop_btn re-appears.
In case the user allows the music to play without interruption, stop_btn turns into play_btn when the song ends.
Below is the script I put on the first frame of the timeline. The music plays, and the onSoundComplete function operates as planned, but the buttons themselves don't do anything. Can someone tell me what I'm doing wrong? Thanks a bunch!
-------------------
//Start playing welcome.mp3
var my_sound:Sound = new Sound();
my_sound.attachSound("welcome.mp3");
//When song stops playing by itself, switches stop button to play button
my_sound.onSoundComplete = function() {
tellTarget ("_root.BGM_controls") {
gotoAndPlay("stout");
}
};
my_sound.start();
//Behavior for stop button
_root.BGM_controls.stop_btn.onRelease = function() {
my_sound.stop();
tellTarget ("_root.BGM_controls") {
gotoAndPlay("stout");
}
};
//Behavior for play button
_root.BGM_controls.play_btn.onRelease = function() {
my_sound.start();
tellTarget ("_root.BGM_controls") {
gotoAndPlay("stin");
}
};
-------------------
Functions Giving Me Headaches. -Flash 5-
Hey everybody, I'm having some function problems that I can't figure out how to solve. I have a movieClip (instance name "playingsquare") and when I press a button a grid is supposed to be formed made of duplicates of playingsquare. To do this I have two functions. When the button is pressed it calls the "makestandardboard" function. The makestandardboard function calls the "makearow" function several times. The makearow function contains a while loop which duplicates the MC playing square across the screen. The problem is that the only duplicate movieClips that show up on the screen are those from the last row created. Here is the code.
*****Button is pressed*****
on (release) {
j = 0;
x = 0;
makestandardboard();
}
*****makestandardboard*****
function makestandardboard () {
makearow(32, 245, 85);
makearow(48, 165, 95);
makearow(56, 125, 105);
}
*****makearow*****
function makearow (rowlength, xvalue, yvalue) {
x = 0;
for(i=0; i<rowlength; i++) {
_root.playingsquare.duplicateMovieClip("playingsqu are"+j+i, i);
_root["playingsquare"+j+i]._visible = true;
_root["playingsquare"+j+i]._x = xvalue+x;
_root["playingsquare"+j+i]._y = yvalue;
x += 10;
}
j++;
}
With this code, only the last row, makearow(56,125,105), is the only one that will be visible. If I create another row after that, the new one will be the last row. I even made an array of all the squares that were being created to make sure the last row wasn't the only one being created and found I was right. All the squares are being made but only the last row is showing up. Any help would be greatly appreciated.
Thanks,
-Steve
Background Headaches... (trying To Reproduce Bg-effect As Seen On Robertreich.de)
Hi there,
I'm looking to create an SWF-based tiled background that fills the entire browser window. My flash interface should be smack bang in the middle of this. The problem is this: How can this background and this interface co-exist in the same swf with the interface recentering itself on resize, but with the background remaining untouched?
For an example of what I mean, go to http://www.robertreich.de (try opening an image-based background on the menu).
Any help would be much appreciated. Can't seem to crack this one
Best regards,
Terpentine
Gallery Headaches ..Owwwww.....brain Exploding ....Boof
I am calling up HTML galleries from a flash movie.
Why do the html pages always appear behind my flash movie?
I need them to pop up infront of the flash movie, sans the tool bars too. Any suggestions? please keep it simple i am still a rank newbie at HTML and Flash.
j5
out
Totally Lost Form Mail And Perl Script Headaches
Could someone take a look at my files please. I have spent the last week trying to get this #@!$ thing to work. I am attaching my fla
and the perl mail scripts are below. When I test the output of the sendVars object, the variable values are correct. If I execute the sendMail script on the server, it opens a window showing successful execution. But when I try the site, I get nothing.
I am so lost and almost bald from ripping my hair out.
thanks,
chosenson
********************scripts**start**************** ********************
#!/cgi-bin/CGI.pm
require "subparseform.lib";
&Parse_Form;
$Email = $formdata{'userm'};
$FirstName = $formdata{'usern'};
$Subject = $formdata{'subj'};
$ToComments = $formdata{'bod'};
$HearAbout = $formdata{'HearAbout'};
$ToEmail = "chosenson@excite.com";
$ToSubject = "Study Buddy User Mail";
$EmailBody = "Sent By: $FirstName
Senders Email: $Email
Senders Subject: $Subject
Message Sent:
$ToComments
Sender Heard About Site From: $HearAbout
";
$EmailFooter = "
This message was sent by: $FirstName. This message needs immediate attention!";
$Message = $EmailBody.$EmailFooter;
open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $ToEmail
From: $Email
";
print MAIL "Subject: $ToSubject
";
print MAIL "$Message
";
close (MAIL);
print "Content-type: text/html
";
print "_root.Mail.EmailStatus=Complete - Your mail has been sent";
sub ErrorMessage {
print "Content-type: text/html
";
print "_root.Mail.EmailStatus=Connection Failed Please Check the path to the Mail program";
exit; }
*******************subparse.lib*********starts*her e*******************
sub Parse_Form {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
if ($ENV{'QUERY_STRING'}) {
@getpairs =split(/&/, $ENV{'QUERY_STRING'});
push(@pairs,@getpairs);
}
} else {
print "Content-type: text/html
";
print "<P>Use Post or Get";
}
foreach $pair (@pairs) {
($key, $value) = split (/=/, $pair);
$key =~ tr/+/ /;
$key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~s/<!--(.|
)*-->//g;
if ($formdata{$key}) {
$formdata{$key} .= ", $value";
} else {
$formdata{$key} = $value;
}
}
}
1;
Simple /:xpos Scrolling, However Load External .swf When Scrolling Stops
Hi guys I need some help with a simple horizontal slider. (See attached)
Basically I have a horizontal slider with 3 buttons which make the slider go to a specific position using:
on (release) {
/:xpos = -376;
}
Now what I want to happen is that when the button is pressed I want it to load an external .swf movie (say video.swf onto level 1)
I have tried just adding using:
on (release) {
/:xpos = 0;
loadMovieNum("video.swf", 1);
}
which just loads the movie and then scrolls. However I need it to be the other way around. It scrolls to the location and then loads the movie.
I would really like it to use some type of statement telling it that if xpos = -350 then load .swf onto level 1 and if xpos has not yet reached -350 to do nothing.
However the major principal is to get the scroll and then the load, rather than the other way around.
Cheers
Dom
Scrolling Text Field That Stays Scrolling On Rollover
on (rollOver) {
mytext.scroll--;
mytext.maxscroll = x;
}
Here is my code, you have to keep clicking the button to scroll the text field, how do I code it to just have the mouse rollover the button and the text field will continue to scroll automatically? Thanks.....
On Press Scrolling Problem. Scrollbar. Scrolling. Button
How do I make this actually work for on press? It works fine for when you just click it, but the on press function doesnt work.
thanks for any help.
on (press) {
textbox.text._y += scrollVal;
if (textbox.text._y>upperLimit) {
textbox.text._y = upperLimit;
}
lineLoc = slider.line._x;
linelength = slider.line._width;
slider.handle._x = ((textbox.text._y/lowerLimit)*lineLength)+lineLoc;
}
Using Flash Scrolling Text Box To Create Scrolling Schedule
Hi All,
For work, I'm creating a PowerPoint presentation which needs to include a really long schedule. I wanted this schedule to crawl up the screen. I thought of doing this part in Flash and inserting it into the PPT. Has anyone had luck with this sort of thing using PPT and Flash? Is there a better strategy. I have CS3 Web and Production and will be doing this portion of the project this weekend and thought I'd ask some pros. Is there another CS3 product that might be better. I am more Familiar with After Effects but haven't used it for anything quite like this before.
Thanks!
How To Smooth The Movement (scrolling Background And Scrolling Menu ) ?
hi! i'm new here and also a beginner in flash.. i need some help on how to smooth the movement in my flash project.. scrolling background with scrolling menu.. i got this script from a tutorial and i did some adjustment on it.. but somehow both the background and menu movement are not smooth as i want. its kept jerky along their movement. this is the script that i use to move both background and menu.. hope someone can help me to repair or to alter this script.. thanks! =)
//scrolling background with scrolling menu
//when mouse moves left, background and menu moves right
if ((_xmouse>-0.5) && (_xmouse<230) && (_ymouse>-0.1) && (_ymouse<450)) {
_root.back._x =_root.back._x +6 ;
_root.menu_mc._x =_root.menu_mc._x +10 ;
}
// when mouse moves right, background and menu moves left
if ((_xmouse>400) && (_xmouse<616) && (_ymouse>-0.1) && (_ymouse<450)) {
_root.back._x =_root.back._x -6 ;
_root.menu_mc._x =_root.menu_mc._x -10 ;
}
if (_root.back._x>1309.5) {
_root.back._x = -79;
}
if (_root.back._x<-697.8) {
_root.back._x =679;
}
//----------------------------------------------
if (_root.menu_mc._x>1200.5) {
_root.menu_mc._x = -99;
}
if (_root.menu_mc._x<-730) {
_root.menu_mc._x =569;
}[/size][/size][/size][/size]
(quickie) Scrolling HTML Field Not Scrolling To The End
Hey guys and girls,
I've got some data from a file displaying in a wrapped, HTML textfield. text is formatted and appears as expected but as i try to scroll, it only scrolls one line down and stops.
the maxscroll property returns 5, and the scroll goes down to 2 and for some reason won't go further down.
but, and here's the fun part driving me f*3%# nuts... if i select the field and then use arrows, i can scroll it that way... but then once i've done that, the buttons work too. I tried using the selection object .. but nothing... and i've turned off the HTML and seen that scroll (probably coincidently) would have a maxscroll of 2.
so question is... what the ****? how can i get thing to work? thanks world. peace.
|