How Could I Create This Mechanism?
Hi guys,
Being the Actionscript newbie that I am, I was wondering if anyone would be kind enough to help me add some interactivity to a project I’m currently working on. I’ve made a rough animated prototype of what I’m trying to do which I’ve linked below, as well as a Flash file with the relevant graphics in for anyone who wouldn’t mind helping me out.
The animated Shockwave file is linked here
The Flash file is linked here
What I’m trying to create allows a user to interactively part two bushes, to reveal a picture beneath. When the bushes are returned to the original position by the user, the picture is randomly changed. The user therefore sees the new image the next time he parts the bushes.
• The user positions the cursor over one of the bushes, and moves it by holding down the mouse button and dragging in a particular direction. The opposite bush mirrors the movement of the first.• The movement of the bushes is a bit like a pair of scissors, with both graphics anchored to a single point. When the bushes move, they rotate around this single point.• The functionality of the bushes is a bit like that of a scroll bar in Internet Explorer; if you move the mouse cursor off them, they no longer respond to mouse movement. Also, if the user stops interacting with the bushes mid-rotation, they simply stay where they are.• Both of the bushes should also have a rotation limit, so that they can’t be rotated 360 degrees. These would be at 0 degrees (their original, upright position) and 90 degrees (clockwise or anti-clockwise, depending on it being the left or right bush).• As I mentioned before, each time the bushes are returned to their original position, the picture beneath changes. This change should be invisible to the user, so I guess that when both bushes are returned to their original, upright position, the new image is loaded on the layer beneath the bushes.If I haven’t been clear enough about something, I can post up some extra information or answer any questions. Thanks in advance for anyone who is willing to help!
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-19-2006, 12:25 PM
View Complete Forum Thread with Replies
Sponsored Links:
Rotary Mechanism
Hi guys,
I was wondering if someone could help me out with the Actionscript for a mechanism that I'm trying to get working in Flash. I've attached a Flash file with the relevant graphics in it. The explanation beneath describes what I'm actually trying to do: -
The Flash file is linked here
This is quite a simple mechanism; basically, the user is able to rotate the wheel behind the grey overlay, by clicking and holding down on it with the mouse button, and then dragging either clockwise (down) or anti-clockwise (up).
The wheel is anchored from the centre, and rotating it allows different images on the wheel to be cycled beneath the window on the grey overlay.
Is it possible to make it so that the wheel can only be rotated if the user interacts specifically with the exposed part of the wheel on the right side of the grey overlay? This would have the effect of forcing users to have to keep repositioning their mouse and dragging up or down, which is more akin to a real-life rotary mechanism. This isn’t overly important, but if it’s easy to implement, then that would be great.
Thanks in advance!
View Replies !
View Related
Timer Mechanism
Hi again!
[Summary]
I got to make a button btn_Show oppens and closes repecting a timer interval;
roll over button-->creates dynamic menu
roll out --> set interval
set interval --> wait 300 ms then close/destroy menu, but, if roll over is trigered befor the timer executes, then, ignor timer, else do timer!
I have so far:
ActionScript Code:
// setting axx player systemvar axxMenuCreated:Boolean=false;var axxTimeCounting:Boolean=false;var axxBGfreez:Boolean=false;btn_Show.addEventListener(MouseEvent.MOUSE_OVER,axxOVER);btn_Show.addEventListener(MouseEvent.MOUSE_OUT,axxOUT);function axxOVER(e:Event):void { if (axxTimeCounting==false) { axxMenu("create"); } else { axxTimeCounting=false; }}function axxOUT(e:Event):void { TimePassed();}function TimePassed() { var yanImik:Timer=new Timer(300,1);// Timer 1000 = 1sec yanImik.addEventListener(TimerEvent.TIMER,TimePassedExe); yanImik.start(); axxTimeCounting=true;}function TimePassedExe(e:TimerEvent):void { if (axxTimeCounting==true) { axxMenu("delet"); }}
[SYMPTOMS]
if i roll over/out verry fast, this creats menues over menues!!
[MORE INFORMATION]
whatever i try, i get either one of this errors:
1 . many menues get created above menues
2 . i call the delete menue function even ther's nothing to delete resulting in removechild error
thanx for any tips!
View Replies !
View Related
Hitting Mechanism In Flash......
Hi all,
What is Hitting Mechanism in Flash?. Just check out this http://www.neostream.biz/shop/ec/Cat...ainCat=2&PID=8 and click on the demo.
It says it has been done with flash scripting using character hitting mechanism.
Can anyone brief?????
Wiaitng for your reply.....
View Replies !
View Related
Safe Mechanism For Game
ok, this is going to be a long one...
i'm making a flash educational game, and i have an idea to make an activity where the user has to enter the combination to a safe.
I made an extremely simple version with an input text box and a button. but now I'm thinking to make a version with 5-6 different boxes. I want a number in each box which will rise when clicking the up button, go down when clicking a down button.When all the boxes have the right number in them, the main button can be pressed and the safe can open. I have the barest idea of how to do this with variables and the like, but I'm still a relative beginner and any tips would be much appreciated
View Replies !
View Related
Flash Detection 5/6 Mechanism
I am interested to know how to make a flash detection mechanism in the player. Basically, I want to make a main page that detects what version of flash is currently installed. I know many web pages already do this. If it is version 5 then the movie will inform them they need to upgrade and will provide a hyperlink. If it is version 6, then the movie will play uninhibited. So here is what I have tried so far:
ActionScript Code:
test = getVersion();
if (test == 5){
status = "YOU HAVE AN OLD FLASH PLAYER-PLEASE UPGRADE TO VERSION 6";
} else {
status = "CURRENT";
}
My problem is, I cannot get my text message to display when a Flash 5 player visits my page. Is there something I am missing?
Thanks!
View Replies !
View Related
If Statement Problem On Fade Out Mechanism
I have a scene fully set up.
On the top layer is a large black movieclip that covers all. I set the alpha to 0 in frame 1.
There is one button in the scene that let's the alpha of the big MC go from 0 to 100, creating the effect of a fade out of the entire scene.
When the alpha = 100, I want the scene to play frame 20. I thought this would work but it doesn't...
Here's the code on the big MC. What is wrong in the if statement? Even when I set if (_root.fader._alpha > 90), the scene will not go to frame 20. Do I have to put this if statement somewhere else?
onClipEvent (load) {
speed = 2.5;
_alpha = 0;
}
onClipEvent (enterFrame) {
diffalpha = endalpha-_alpha;
alphachange = Math.ceil(diffalpha*(speed/10));
this._alpha = this._alpha+alphachange;
if (_root.fader._alpha == 100) {
gotoAndStop(20);
}
}
This is the code on the button that triggers the alpha change fro the MC:
_root.menuknop.onRelease = function() {
_root.fader.endalpha = 100;
};
I hope someone can clear this up for me...
Thanks,
wouter
View Replies !
View Related
Trouble With Listener / LoadVars Mechanism
I'm building a fairly simple dynamic photo gallery script with PHP and MySQL. The variables are loaded using loadVars, images are loaded into movie clips stacked on top of one another, and the back / next buttons change the _alpha on the stack of images to "switch" between them. This much of the script works fine - it's when I try to replace the existing images with a new set.
The way I want users to be able to toggle between projects (the images are organized by project) is by a pulldown menu component. The pulldown populates, functions and displays correctly.
PHP Code:
for (i=1; i<=imageinfo.total_projects; i++) {
project_id = 'project'+i+'id';
project_title = 'project'+i+'title';
pulldown.addItem({data:imageinfo[project_id], label:imageinfo[project_title]});
}
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
trace("Newly selected project: "+evt_obj.target.selectedItem.data);
_root.selected_var = evt_obj.target.selectedItem.data;
_root.gallery_pics.removeEventListener("change", cbListener);
_root.gallery_pics.gotoAndPlay(1);
};
pulldown.addEventListener("change", cbListener);
stop();
By the way, all of this is going on in _root.gallery_pics.
The actual problem occurs when I select a new project from the pulldown. I've got trace actions in place to see what's going on, but the movie goes into an infinite loop and freaks out. The listener sends the movie back to frame 1 - this is intended to delete the existing movie clips and unset the variables... I'm not entirely sure the latter part is necessary, but I'm pretty much grabbing at straws here.
PHP Code:
for (i=this.imageinfo.total; i>0; i--) {
this['img'+i].removeMovieClip();
trace('Deleting img'+i);
}
delete imageinfo.total_projects;
this.imageinfo.length = 0;
delete this.imageinfo;
delete _root.gallery_pics.i;
this._alpha = 0;
delete _root.gallery_pics.picStatus;
trace('Images and variables reset');
gotoAndPlay(2);
This frame seems to go through just fine. But when the script goes to frame 2, that's when the problem occurs.
PHP Code:
stop();
// Plays the movie once images are loaded
this.onEnterFrame = function() {
_root.gallery_pics._alpha = 0;
percent = (_root.gallery_pics.last_image.getBytesLoaded()/_root.gallery_pics.last_image.getBytesTotal())*100;
if (percent == 100) {
_root.gallery_pics._alpha = 100;
_root.gallery_pics.play();
delete this.onEnterFrame;
}
};
// Loads variables
imageinfo = new LoadVars();
if (_root.selected_var == undefined) {
// No project selected, load the latest
imageinfo.load("http://bya.localhost/scripts/flash_gallery.php");
trace('Loading latest project');
} else {
// Load selected project
imageinfo.load("http://bya.localhost/scripts/flash_gallery.php?project="+_root.selected_var);
trace('Loading project number '+_root.selected_var);
}
trace('Begin onLoad');
imageinfo.onLoad = function(success) {
if (success) {
trace("Variables loaded");
_root.gallery_pics.i = imageinfo.total_photo;
trace('Total Photos: '+imageinfo.total_photos);
// Loop to load images
for (counter=1; counter<=imageinfo.total_photos; counter++) {
this.imageName = 'img'+counter;
this.imageLoc = this[this.imageName];
trace('Image name: '+this.imageName+', Image location: /'+this.imageLoc);
_root.gallery_pics.createEmptyMovieClip(this.imageName, counter+100);
with (_root.gallery_pics[this.imageName]) {
loadMovie('http://bya.localhost/'+this.imageLoc);
_x = 33;
_y = 108;
}
if (counter == imageinfo.total_photos) {
_root.gallery_pics.last_image = _root.gallery_pics[this.imageName];
}
}
_root.gallery_pics.i = _root.gallery_pics.imageinfo.total_photos;
_root.gallery_pics.picStatus = _root.gallery_pics.i+' of '+_root.gallery_pics.imageinfo.total_photos;
} else {
trace("Error loading variables");
}
};
The output window indicates that the script starts to hang during the onLoad event. It tells me the script is causing the movie to run slowly and asks me to abort.
The only thing I could imagine is that I'm doing something wrong with loadVars that I don't know about. Like maybe I shouldn't be trying to load new variables into the same object? Maybe I'm not deleting it properly? Can anyone help?
View Replies !
View Related
[F8] Need Action Script Help - Timing Mechanism
I have an animation that I'm working on that I need help with.
I have linked the file so you can see what I've done (based on a template). It is too large to attach on this site.
Download source file from my site here: www.childressmarketing.net/test_moving_images.fla
Here is a link to the SWF file:http://www.childressmarketing.net/up...rts_movie4.swf
What I need now is for the images to change on their own until a box on the right is clicked on. Right now, you can only change the message by clicking on a box on the right.
So, I want the first message to come up and remain for 8 seconds or so, then change to the second message for 8 seconds or so, and so on until someone clicks on the boxes to the right.
Once someone clicks on the boxes on the right, I want the timed changes to stop.
Can someone help me with this? I would appreciate it much!
View Replies !
View Related
Which Setting Control Update Mechanism?
For QC testing of existing sites, I need to install earlier versions of the Flash 9 player. During installation, I receive the message that later, more secure versions exist. Installation procedure stops. For backwards compatibility, I still need to be able to check older versions. Found the answer in Technote http://www.adobe.com/go/kb402435. Safe versions security restrictions when installing Flash Player (Internet Explorer on Windows)
Edited: 10/25/2008 at 06:24:43 AM by Rudolf_71
View Replies !
View Related
Activation Mechanism For Flash Exe Via Actioscript
I intend to develop and sell a flash app that will be distributed as an EXE.
I'm thinking about a mechanism to activate the app once a user pays for it
and then tie the activated copy to the user's machine..
Is there a way, using actionscript or any other flash mechanism, to
1- grab a unique ID of some sort of the user's machine (e.g. partial windows' product ID and or partial motherboard product ID)
2- store that value in the registry.
The idea is, if the user moved his copy of the app to another machine, he'd not be able to use the app.
thanks in advance.
View Replies !
View Related
Complicated Loading/unload Mechanism
Hi folks!
Who can give advise... How can I accomplish complicated loading and unloading mechanism?
for example section number one is divided into the blocks.
so when you hit the menu button, section is loading by parts...left part, after that center part and then right. when you press next menu button, first of all this section is unloading... center part, then right part, then left part and after that section number two begin to load in a different manner.
so question is how can i control that? for loading and unloading i have got functions load_main() unload_main() load_contacts() unload_contacts()
Hope my explanation is clear...
View Replies !
View Related
Complicated Loading/unload Mechanism
Hi folks!
Who can give advise... How can I accomplish complicated loading and unloading mechanism?
for example section number one is divided into the blocks.
so when you hit the menu button, section is loading by parts...left part, after that center part and then right. when you press next menu button, first of all this section is unloading... center part, then right part, then left part and after that section number two begin to load in a different manner.
so question is how can i control that? for loading and unloading i have got functions load_main() unload_main() load_contacts() unload_contacts()
Hope my explanation is clear...
View Replies !
View Related
Create, Delete, Create Event Handlers
Hi,
At the moment I create an onEnterFrame function to ease a movie clip into view. I then delete it. I want to be able to recreate a similar onEnterFrame function later to swoosh the movie clip out of view. At the moment weird things happen when I try and do the second onEnterFrame. Am I doing something illegal here?
I know I could put this all in the original onEnterFrame, but I don't wanna be wasting processor time doing an if statement every frame to work out if it's time to swoosh out the movieclip. Or should I not worry because that's negligible cpu time?
Tom
View Replies !
View Related
Create A
Any help with this would be very, very appreciated.
I'm looking to create a flash animation that would allow the user to "scratch off" a section of the animation, revealing things underneath. I've yet to figure out a way to allow user input to change the alpha value or visibility of a part of a clip, so I figure the only way to allow the user to scratch something off is to have each pixel be its own clip (with its own alhpa value and visibility).
You can see the obvious problem here; running a duplicateMovieClip command 600 times takes forever and tends to crash Flash.
I've seen this done in Director, but I figure that's just one of those Director features that Flash lacks.
Any help at all -- plans of attack, etc. -- would be much help.
Thanks,
Dan
View Replies !
View Related
Help To Create A Swf Like This
Is There a tutorials to create a flash like this?
how this swf file work?
http://fifaworldcup.yahoo.com/es/
if you can't see the flash just click in Replay Ad under Budweiser ad
[Edited by garcacesarpo on 03-17-2002 at 12:58 AM]
View Replies !
View Related
How To Create These?
Hey Everyone,
I how do i create those preview consols (graphic eq)in the soundfx sections of this flash kit site.which reacts the the sound clip being played?
See here to take a look.
http://www.flashkit.com/soundfx/Instruments/
Any ideas?
Thanks in Advance!
Blue Dragon
View Replies !
View Related
How Would I Be Able To Create.....
Hey.. I am recently pretty new to Flash MX and im trying to get into the more advanced features like the action script, but only find dust when i use it.. =/. I know allll the basics but 1 thing i would like to know if someone could help me is... how would I be able to load a movie SDF.swf and see how much bytes total, and how many bytes I have loaded? Just a quick question if someone could answer please...
View Replies !
View Related
Trying To Create App....please Help
I want to create an app where txt files can be loaded into a form (which will be a flash executable file) and appear in the proper fields. Is there any open source file like this? Or any file that can help me?
Any help would be greatly appreciated.
View Replies !
View Related
How Do I Create A Swi
i want to post my movie but it only accepts swi not swf so it wont let me attach it so how do i make a swi either that or how do i compress sometihng into a zip i have never done it before thanks
View Replies !
View Related
How Do I Create Something Like This...?
If you go to this site http://ramblinwreck.ocsn.com you will see at the top right hand corner a scoreboard. I would suspect that it is pulling the scores from a file or database? How can I easily create something like this in Flash MX?
Thanks in advance,
TDSILK
View Replies !
View Related
Can I Create....
what I want to do is this... I don't know the syntax, but I can tell you what I want generally...
This is it
in one frame on the syntax
On Button release ... Variable equals this
on another frame the syntax is this
if variable equals this, go to and play frame this
that's it, that's all I want
-BpG
View Replies !
View Related
Trying To Create A Pop Up
Hello,
Man, you guys are the best for us n00bs.
Anyway, I am trying to create a pop up window which is seemless. what do i mean by that? I mean, that it has no "title" bar at the top, just a boarder.
I don't have an example, unfortunately.
Anyway, are there additions to java code that would creat the window like that?
Again, thank you for your help.
View Replies !
View Related
How Would I Create This
I want to build a timeline similiar to the one at:
http://www.bioport.com/AboutBioPort...ne/timeline.htm
Where can I find a tutorial for something similiar... especially the scrolling time bar at the bottom.
I'm using Flash 5, but would consider upgrading to MX if it would make this project easier.
Thanks!
Michelle
View Replies !
View Related
Create Xml?
------------------------------------------------------------------------
I recently created a quiz that pulls its questions and answers from xml files.
Now I am hoping to create a second flash application that allows the user to create the xml files. I have been able to set up a user interface that allows the user to type their questions and answer into various text boxes. When they are finished they press a button and using the createElement, and appendChild codes the xml is created.
I am having a problem with the next step. How do I "save" the xml the user has created to an outside file that can latter be picked up by the Quiz. (The whole thing will be installed on the user's hard drive from a CD).
Any help would be greatly appreciated.
View Replies !
View Related
How Do I Create This?
Hi all,im wondering how do i create this effect (http://www.2advanced.com/flashindex.htm ) when i click on one of the menu,the 'main frame' screen enlarge,and when i click 'expand'the screen goes back to its original size.
View Replies !
View Related
How To Create ?
Im creating a football coaching cd-rom package.....i've produced drills in flash, which play and pause at key areas, with the user selecting next to carry the drill on. I want to add a slider bar underneath the movie giving the user the option to 'slide' to any part of the drill by using the slider. Is this possible, help would be great ! Thanks.
View Replies !
View Related
Create Name Help
Create Name:
I am creating a game, And you get to create your own name, Ive layed out all of the letters and symbols I want. Heres the code for the letters:
on (release) {
_root.name += "A";
}
Of course, A is A-Z. The same code for all my letter buttons just B-Z.
Now, My problem is the getting rid of a mistaken letter. I couldnt finda or create a code to subtract a letter.
If any one knows how to do this, Please help out.
"there is no spoone" - The Matricks
View Replies !
View Related
How To Create XML On The Fly With PHP ?
Hi,
I am creating a directory browser ,Actually my flash reads the directory lists from the XML file called "tree_source.xml". this xml file created by a php file . Now i want modify the php file in such a way that flash directly reads the directory structure from the php file inorder to speed up the browsing.
This is my flash script.....
// load and assign data source
myTreeDataProvider = new XML();
// ignore whitespace in XML (important)
myTreeDataProvider.ignoreWhite = true;
// load external XML file
myTreeDataProvider.load("tree_source.xml");
// onLoad handler for XML data
myTreeDataProvider.onLoad = function()
{
myTree.dataProvider = myTreeDataProvider;
}
// set up tree listener
myTreeListener = new Object();
This is the PHP Script to create XML
$photodir = "/albumshan";
$path = getcwd().$photodir;
$fp=fopen("tree_source.xml","w");
fwrite($fp,"<root>");
structure($path,$fp,$path);
fwrite($fp,"</root>");
fclose($fp);
// Function
function structure($rootdirpath,$fp,$dir)
{
unset($root);
if($dp = @opendir($rootdirpath))
{
for($i=0;($file=readdir($dp))!==false;$i++)
{
if (is_dir($rootdirpath."/".$file) && $file != "." && $file != "..")
{
fwrite($fp,"<node label="".$file."">");
structure($rootdirpath."/".$file,$fp,$dir);
fwrite($fp,"</node>
");
}
}
}
closedir($dp);
}
Please help me ..
Shan
__________________
View Replies !
View Related
Help - How To Create Pop-ups?
i made a button and i want it to open the enlarged version of my thumbnail..
the border should be just a standard xp blue menu thing. no internet explorer buttons and stuff
how the hell is this possible?
a thousand thanks in advance!
View Replies !
View Related
I Want To Create A Map Of The U.K
without having to draw it out manually everytime, how can i achieve this.
i want to make something close to this: http://www.shadowandlight.net/
but instead of europe i just want the U.K, so i need maps or segmants of the UK. can anyone help?
View Replies !
View Related
[F8] How Do I Create Something Like This?
Greetings!
Im trying to recreate a game that ive found online as a bit of fun and a nice way of learning flash, but i can't seem to get my head round it and it's really got me stuck. I thought it would be easy as it seems such a simple game:
http://www.ferryhalim.com/orisinal/g2/applegame.htm
I just can't figure out how the apples work. If anyone has any suggestions that would be great.
Please feel free to look at my fla file
Thanks
View Replies !
View Related
How Do I Create This?
Ok - I am a newbie to graphic design within flash and was wondering if someone could point me in the right direction. what program would I use to create a graphic like the one one you see here...http://www.lenderhomepage.com/conten...&acctid=100770 - the darker blue, arched graphic underneath the navigation.
I'd appreciate any help I can get.
Thanks!
View Replies !
View Related
How Can I Create This?
I have noticed most sites are now created full in flash like this one for an example - http://www.zigideas.com/welcome.html - how would I create this? and how large would the flash movie have to be? - any help would be great and appreciated!!!
View Replies !
View Related
[CS3] Is There A Better Way To Create This FLV?
I'm having some issues with my project. Here is what I have done so far.
I have made a presentation in flash CS3.
I plan on exporting the movie to a .mov
Then converting the .mov into an FLV (using sorenson squeeze) so that the file size is much smaller and I can use the FLV player controls to stream the movie online.
Now in the background I would like to use a looping .mov video however the video is very large. So I figured I would use quicktime to export a bitmap sequence (PNG's) and import that way. However when I do this I get the error:
"Error creating flash movie. There was not enough memory available"
My system is very powerful (Dual core with 4 GB's of RAM)
Now I am kind of stuck. I want the movie to stream (like FLV's on youtube) and I figured there's no better way of doing this all then making everything in flash, exporting to .mov and then converting to FLV via sorenson squeeze.
Any suggestions on a better way? Should I just import the video rather then a bitmap sequence. (there is 451 images at 720 x 480).
Thanks for any input!
Mark
View Replies !
View Related
How Do You Create This?
Please Help!!! I'm in the process of creating a clients website and would really like to incorporate the bubble loading idea as seen on this site:
http://www.caterersexpress.co.uk/
I know that it is generated by actionscript so any online tutorials or step by step help would be very much appreciated.
Thanks
Gray
View Replies !
View Related
Create XML
i am really new in actionscript..
i want to create a XML file using actionscript..
the format of XML file is like follow,
<?xml version="1.0" encoding="utf-8"?>
<PERSON>
<id></id>
<area></area>
<amount></amount>
</PERSON>
the data for id, area and amount wl keep increasing, depends on how many record i hav...
wat i has done now is as follow,
Code:
xmlTableInfo = new XML();
xmlTableInfo.xmlDecl = "<?xml version="1.0" encoding="utf-8"?>";
xmlTableInfo.appendChild( xmlTableInfo.createElement("PERSON") );
???
i don't know how to loop the data into id, area and amount tag...
please help me.... thank a lot...
View Replies !
View Related
|