ActionScript 2.0 :: Image Placement Algorithm Or Logic?
Jul 31, 2010
I'm builiding some sort of data portfolio in a section of a website. The method i'm using is the next one:
- Load an XML with all the data
- Call a function to build the portfolio.
- Use a "for" within said function to place all of the images at their respective positions
So, what I'm trying to achieve is to place the all of the nodes at the same time on and off screen following the next pattern:
[Code]...
View 1 Replies
Similar Posts:
Nov 23, 2009
what i m trying to do is load a image form xml and resize it to fixed height and then to centre the image on stage...however the following code is not resizing the image and neither is it centering the image...i used trace commands to check its width but i get the output as undefined also on load the images r coming rotated 90 degree.
here's my code
Code:
var slidexml:XML = new XML();
slidexml.ignoreWhite = true;
var currentIndex:Number = 0;
[code]...
View 1 Replies
Apr 16, 2007
I'm trying to test something out in flash with XML and waswondering if anyoone could point me in the rght direction of atutorial.I'm working on a project where I need to be able to pin pointseveral shots that were taken on a golf course. I Need to be ableto load in several jpegs and then on these plot the points at whichthe ball landed.I know this can be done using XML to load in the images buthow do I go about then ploting points over the top of the image
View 2 Replies
Sep 14, 2007
I just found an interesting script, supposedly I heard it is used for image showing. Using thumbnails but the main mc is showing an enlarged version of the thumb you click on. In this script, is it an xml file that loads the images or do they lye in an external folder? if so what are the name of the folder, and is there a system of what the image names are?
Code:
function noCache() {
var __reg1 = String((new Date()).getTime());
__reg1 = "&nocache=" + __reg1;
return __reg1;
} function init() {
numImgs = ImgData.bildarkiv.images.image.length;
[Code] .....
View 1 Replies
Feb 7, 2007
I have a image of burlap @ 500 width x 430 height. I need to tile this as my entire background for my full screen flash site. flip the image horizontally for every other placement horizontally, and then i need it to flip vertically for every other Vertical placement. So the image only looks seamless if i do this. I have a illustration below to help show what i mean.
[Code]....
View 2 Replies
Dec 9, 2011
Would like to understand the basic process behind an ecard before I attempt to construct one!Obviously there could be the following elements:Initial web page containing a Swf (choose swf) offering a user a choise of ecards and a consisting of a series of text input fields to collect recipients and senders address and a message. With actionscript that calls a php file on the server.
Passing variables holding the card choise the card text the email from and to etc from swf to php file.The php script runs and creates a copy of a swf card, the one chosen by the user(swf1) It populates the swf copy with text from the variables set by the choose card swf.the php then sends an email to the recipient address with ? and this is where I am unclear?Does it send an attachment of the swf1 or how does it do it?
View 2 Replies
Dec 20, 2010
[flash=]
package app.demo.MyTouchApp{
import flash.display.Sprite;[code]..........
how to perform a search in XML, so I use the above method, kinda hard code I know...for example, I try to search " keyIn:String = "BR1014"; " means I wanna search BR1014 in 4 XML files, so I load the XML info into an array, and using for loop to loop the XML array (in this case TitleArray1[i], TitleArray2[i]...) and compare it with keyIn (which store the value BR1014), some how the value is located in TitleArray4[i] which have the length of 12 (trace(TitleArray4[i].length) = 12)
so everytime I run it, I will overwrite abc 12 times... and out put 12 time the abc value, in this case BR1014 was located in TitleArray4[3], so the 4th output of "abc" is BR1014 but others is all 999...
View 2 Replies
Sep 19, 2005
Im doing a tutorial in a book that moves a car from one end of the screen to the next by buttons.When you release a button it moves the car 10 pixels more down the X axis.The code confuses me and I want to understand it Please Help!
Here is the code:
// stop the cars traveling
stop();
// callback for onPress event on 'back' button
back_btn.onPress = function() {
// move my car -10 pix
[code]...
Why does the - sign and + sign appear before the = instead of after?Is this a logic operator(-= or +?Why doesn't putting the - sign or + sign after the = work?
View 2 Replies
Jun 4, 2011
I have table
words = [aaaa, bbbb,cccc,dddd,eeee,ffff]
and i want to make table like this:
words2 = [aabb,bbaa,ccdd,ddcc,eeff,ffee]
View 1 Replies
Dec 14, 2011
I have a database which has 2 tables:
CREATE TABLE RecipeDB (
RecipeID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR,[code]........
I also have an actionscript, in which I have ingArr:Array of ingredient strings.Now, I would like to realize the following queries here:
1) Select (all fields) one recipe which has the most of ingredients from the array. If more than one record have the same amount of matches, then divide the number of matches by total number of ingredients in recipe and return the one with the highest ratio. If there are no matches return nothing.
2) As above, but return 10 recipes with the most matches and do not perform check for equal number of matches. Sort the results by the number of matches.
View 2 Replies
Jan 19, 2011
In a RIA application you are supposed to put as much business logic as possible outside of the RIA layers (flash/silverlight etc). What is the reason behind this? Any logic that goes into the presentation tier gets the benefit of executing faster...
Is this because the RIA technology will most likely need a face lift down the road and you will have to rewrite all the business logic?
View 3 Replies
Feb 5, 2011
I was given a task to make a match making game in actionscript 2, problem is, i have very little knowledge about the language (well, and how matching works in as2, what are the important codes, code emplacements, and all I am new in AS2, and i really need a lot of help with our project. :)
I plan to match images. But.. I was planning to have a sort of "Compatibility" match-up game, like,..let's say we have two batteries, one has a 50v capacity(how do u measure batteries?) then the other has a 100v capacity, then there's this battery slot that only accepts a 50v battery, then you will have to match this 50v battery to that battery slot, that's my concept for the game, sir. I hope you got what i said, sir. :D
View 1 Replies
Aug 26, 2009
i missed something in the Aplly of ColorTransform, but i can't see...I made a background for the menu buttons that changes depending to the container x position.the problem is that it changes the text color too, and I don't figure why... here is the code :
Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;[code]......
View 2 Replies
May 3, 2010
I want to update 50 "Circle sprites" (sprite with a circle in graphics object) on a timer event. Each circle's radius and position is calculated with a formula based on preloaded xml data.
[Code]....
View 4 Replies
Dec 15, 2011
I want to stimulate sea wave,but I have no idea about it. Is there an example code for it? I know as3 can make many good graphics and text effect, so I want to learn it eagerly,but I don't know which book should I read. Anyone could introduce a good book for me about as3 algorithm? More example code are better in the book.
View 3 Replies
Feb 25, 2010
I am developing my application in flex and JSP, so when I am passing values through HTTP Service Post method with request object but these values are tracing and modifying by testing team so I am planning to encrypt values in flex and decrypt it in jsp.so is there any algorithms like SHA or MD5 more secure algorithms,
[Code]...
View 4 Replies
Mar 1, 2011
I have been trying to implement the Round Up Power Of 2 algorithm outlined in the following link in AS3.
[Code]...
The algorithm works great for most of the values I've tested. It is mentioned that this will return 0 when given an input value of 0 which is technically incorrect but I'm ok with that output. What I'm not ok with is when given an input of 1 I get and output of 1. I'm thinking that this must be a caveat of AS3 and its wonky uint implementation but I can't seem to figure it out. I have also tried using the >>> logical shift operator to the same result. My C is a little rusty, but I'm not sure how this would even return 2 in C. Can someone explain to me whats going wrong here? I assume if an input of 1 was a special case it would have been mentioned in the above link.
View 1 Replies
Jun 10, 2011
Is there any algorithm to perform erase operation in a bitmap? I would like to create functionality similar to how photoshop or other graphic application performs erase. Is erase operation so difficult that there isn't much help (for bitmaps) available? I am OK even with name of an algorithm, I can proceed from there.
View 2 Replies
Sep 12, 2011
I've searched and racked to no avail.. so, does anyone have an algorithm to create a concertina type rectangle, ideally horizontally. The desired effect is exactly like that of normal horizontal Window Blinds (assume they're closed- doesn't matter) of say 30 parts (or slats) of equal height and uniform width.
When such a blind is raised half-way up notice how the parts at the bottom go from dead flat to an increasing value in height, with perhaps the top-most part hanging normally.
Similarly, when the whole Blind is all the way up, all parts are flat. Conversely, when the whole Blind is fully extended, all parts hang at their own, uniform height. It's this "slightly differing but related to my neighbors height" I'm stuck on.
View 1 Replies
Dec 13, 2004
how to implement this algorithm: I have number (1-100), however, it will return to 0, when it meets 10, likewise 11 returns to 1, 12 to 2...
90 -> 0
91 -> 1
...
View 3 Replies
Apr 26, 2008
I have 5 Button movieclips, each with different states, (OVER, OUT, and ACTIVATED)Obviously when you rollover the button, itll play the over animation, itll also apply for the rollout event of the button. When you click the button, itll go to the activated state.Here's my question...What condition will i use so that when a certain button is activated and i click on a different button, the activated button will play its rollout state before going to its idle state.. What's happening to me is itll just quickly go to its idle state without playing his roll out animation.
View 8 Replies
Jul 25, 2008
I am programing with AS2 so here goes my question: I want to create an algorithm that looks up an array and finds the nearest integer in it. Lets say i have different numbers like 1, 2, 4, 5, 8, 9 and i want to find the nearest member to 6 from those numbers. How should i build the algorithm. So far i'm using two arrays and two inside loops, but cant find the right way to make it.
View 3 Replies
Jun 5, 2004
my program calculates ax,ay -> using this variables -> vx,vy -> after that I calculate the little step that my mc will make, in other words I calc x,y position [code]as you can see all depend on each other...but the problem is that after getting new x,y I want this x,y to be used to calculate next step!fo every new coordinate I want new vx,vy ax ay!
View 8 Replies
Dec 13, 2004
I met a problem while I am learning the flash actionscript 2.The question is how to implement this algorithm: I have number (1-100), however, it will return to 0, when it meets 10, likewise 11 returns to 1, 12 to 2...
90 -> 0
91 -> 1
...
View 3 Replies
Oct 13, 2003
is it possible to get an uh... "absolute" X and Y for _root.dropDown1MC.listMC.item? As is stands, I'm placing dropDown2MC on the stage using the following code: [AS]_root.attachMovie("dropDown2", "dropDown2", 30, {_x:_xmouse, _y:_ymouse});[/AS] and that gets it on the stage, but it doesn't function as I need it. In a perfect world, I'd like to place dropDown2MC at the X and Y of item, BUT, there is a mask to only show a certain area of listMC (it's how I'm making a scrollable dynamically populated list).
So, is there a way to get some sort of absolute value, relative to root or something, of item's X and Y coordinates? Sorry if this is a bit complicated... I'm trying to be as clear as possible, but you know how hard that can be when you're connected to Flash directly though a firewire cable to the brain
View 4 Replies
Jul 9, 2009
Where I can find a complete set of Flash CS3 logical errors and what they refer to? I know Adobe has a list but for some reason it is incompelete.
View 2 Replies
Oct 19, 2009
I'm working on an app which will, like most apps, have a whole boat load of buisness logic, almost all of which will need to be executed both on the server and the Flash-based client And I'm trying to figure out the best (read: least complex) way to implement the rules engine.
These are the parameters of the problem:
The rules engine must both run in a web browser (ie, in Flash Player) and on the server. Duplicating the logic (eg, by writing a "server" version and a "client" version) would be an unacceptable risk. The input/output data is fairly complex, so serialization is a nontrivial problem. We are currently using AMF for all of our serialization needs, and using another protocol would add significant complexity So it should probably be avoided. It is infeasible to implement a "rules description language". Experimentation has shown that rules are sufficiently complex that any such language would need to be Turing complete Which would also add a significant amount of complexity. The rules engine will not need to make some, but not very many, service calls.
Currently, the best contenders are:
Writing the code in ActionScript, then running it on the server. In theory it's possible to start up an AVM instance, get it long-polling a gateway, then pass data back and forth that way But that seems less than ideal. Writing the code in haXe. I don't know anything about haXe's AMF support, so that could be a deal-breaker. Something involving Tamarin. Seems like a viable option, but I haven't done enough research to tell either way.
View 1 Replies
May 24, 2010
i want to develop AI car(opponent) in car race game what should be my direction to develop them with less complexity because i don't have any idea. because the player car is moving on the scrolling track plz suggest me should i have to use relative motion or way point concept but that should also be change on the scrolling track (i.e. player car movement)
View 3 Replies
May 29, 2011
I have the following logic in my code
if((leftCombo.getSelectedIndex() !> rightCombo.getSelectedIndex())&&(rightCombo.getSelectedIndex() !< leftCombo.getSelectedIndex())
Doing something wrong obviously.Here are the errorsScene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting rightparen before not.Scene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting identifier before logicaland.Scene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting semicolon before not.
View 2 Replies
Dec 2, 2010
I have the following code below. Is there any way to shorten it by putting it in a for loop. I want all values to be false, apart from go2 which will be true
Code:
var goArray=[go1,go2,go3,go4, go5];
var go1:Boolean=false;
var go2:Boolean=false;[code].....
View 9 Replies