ActionScript 3.0 :: BitmapData Tiling From Holysocks Blog?
Jun 21, 2011I can't get this to work, and I guess it has to do with my knowledge of loading a bitmap
This is what i've got so far:
[Code].....
I can't get this to work, and I guess it has to do with my knowledge of loading a bitmap
This is what i've got so far:
[Code].....
I am trying to make a blog roll program that will put the titles of a client's blog on their homepage. i ran through a tutorial that got most of it working, but when i went to move from the tutorial to the client's program, i started running into some errors. since i have no idea what they mean, i can't even begin to figure out what is causing them.
[Code]...
I am using this code to create a tiled background on a site I'm working on.
tileBG = function () {
tile_width = 128;
tile_height = 128;[code]....
It works great, but because I'm publishing my SWF with noScale at 100% width and height, the background doesnt fill the whole swf, only the size of the actual stage in the FLA. Is there any way I can change this so It will fit accordingly?
I'm building an XML driven video player that will allow users to customize a wide variety of layout/visual features for the player, and one of the important features is letting them switch between a regular background image, and a tiled background. I've been playing around with various methods for tiling using the Bitmap class, and its been working fine, as long as I load the image from the library. However, when I try to load the image dynamically (i.e. through XML), it doesn't jibe.
Here's the code for the tile:
function tile() {
var tile:BitmapData = BitmapData.loadBitmap("linkageIDForBitmap");
this.beginBitmapFill(tile);
this.lineTo(Stage.width, 0);
[code]....
Again, if I write a variable which references the xml node, and use that variable in the loadBitmap function, it doesn't work. I'm assuming this is because the dynamically loaded tile doesn't have a linkage ID attached? Not sure how to do that...
My other thought is to simply load the tile into a movieclip (as I do with all the other content), and then convert the movieclip to a bitmap, then proceed as normal with the code above. I've searched the boards for a method to do this, but have come up empty.
I've seen the Full Browser Flash video which has tiling in the background. Can somebody supply code, and possibly an example of how to have one scalable image as the background without distortion whilst the foreground flash remains the same size. the site below is exactly what i'm after with the menu fixed to the left.
[URL]
Is it also possible to have the menu bar a fixed percentage from the top of the browser?e.
I've seen a lot of posts on how to tile an image in a Flash movie that is being scaled to fit the browser. I found some code posted a while back to do it in MX 2004. (below) Can someone tell me what parts of this don't work in Flash MX? (I don't have 2004) Can this be adapted to work in Flash MX, or does someone know another way to achieve the desired result in MX?
[Code]...
I was trying to work into my 100% width and height backgrounds i have been putting into flash (code at bottom).The question I have is, the duplicate background tutorial only works for the defined space of the flash stage, ie: if the stage is 900x600 - the background will duplicate for that, but anything beyond is just the stage color.How can I make the background duplicate across the entire browser window.
Here is the code being used for my 100% w/h backgrounds (not tiled):
Code:
// Control stage size without content resize.
Stage.scaleMode = "noScale";
_root.bgFull_mc._width = Stage.width;
_root.bgFull_mc._height = Stage.height;
[code]....
I am using the blitting technique that jeff from uses for creating tiles. I am trying to paint 2 layers of bitmapdata onto a bitmap. One the first layer is the background ( 1 image). and the second layer is the tiles. In that class below. the updateMap is the method that gets called in the loop to repaint the image.
package com.eapi
{
/**
[code].....
I have a weird issue that only seems to show itself on IE 8 so far. I have a semi transparent png tiling accross some divs on my site. All works ok. However as soon as i put any flash content on any div on the page, doesn't matter where, IE stops tiling the png and stretches it instead. It only occurs with flash and on ie8.
View 1 RepliesSo I need to tile a number of images to simulate a wall full of framed pictures. The images will be sized randomly onLoad and need to be spaced evenly. Here's is the effect I'm wanting to achieve:
how to pull this off? They'll load one at a time and probably starting in the center of the stage a building outward.
I am working on an as3 slideshow class and I came across a blog post that gave me the idea to use better transitions than the sliding out and fading I originally intended to use. [URL]The source for that class is available and it is a good starting point but I wanted to check and see if anyone know of similar projects that had more effects. Right now I just have the random explode effect from the above link and before I start working on effects I wanted to see what was out there.
View 1 RepliesI took the tutorial on using the bitmapdata to effectively tile a background, but it doesn't tile it across the full screen. Only the size of your flash movie. I want it to cover the entire screen muc like [URL]I'm looking for a way to tile the image across the full background regardless of window size. So if you maximize your browser, the background tiles the the full screen. I've been racking my brain all morning trying to figure it out!
View 6 RepliesI'm using Flash 8, with this code in the first frame:
import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;[code].....
When I publish the file, I'm getting the following error message in the Output panel:
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");
Total ActionScript Errors: 1 Reported Errors: 1
I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData()
at Reflect()
at Site_fla::GalleryPage_29/loadThumbs()
at Site_fla::GalleryPage_29/sortXML()
[Code]...
btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..
I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.
View 3 Replieshow to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.
View 2 RepliesSo I'm creating a classic side-scroller using the Pushbutton Engine [url] and I want the 'world' bits to be any given size, of course, and the repeat/tile my art assets. I've got the following render setup code as a start:
[Code]...
However, that just takes brick.png and stretches/shrinks it to fill the size of the object. Lame. :) I've spent a bunch of time trying to google how to do this, but I'm perhaps not getting the right terms or some such as I haven't come up with anything. Mostly articles on building tile-based games with PBE. While I'm sure I can hack together something that'll do the trick, I want to make sure I'm doing it the right way such that I get the best performance and what not. where I should be looking to pull of this standard effect?
I've attempting to create a tiling image that fills the stage using AS3. Its all well and good until the stage is resized - once this happens things being to look very poor. At first I thought it was a smoothing issue but now I realise that the same image is being drawn over itself again and again. As I want to eventually have this over video, I need the transparency. If I use an opaque image, obviously you cant see the problem.
I've tried adding a condition to remove the child that is being drawn to in several ways but this dosen't seem to work. You can see these commented out in the code below.
[URL]
Code:
import flash.display.Bitmap;
import flash.display.BitmapData;
var _stageHeight = (stage.stageHeight);
[code].....
I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?
View 2 RepliesI've made a mobile version of my software, with low-res images and such, and I can now fully buffer all my content (including a 360 frame animation which is buffered to memory). Problem is, that everytime I update the view, more memory is used.When I write image = new BitmapData();, does it store the previously created BitmapData's in memory? Do I have to flush the memory somehow before I draw my second picture in BitmapData?Example:
ActionScript Code:
// In this example I draw using the same bitmapData several times, also
//overwriting the first image. Do I have to somehow delete the data first, to
[code].....
I've maintained a blog on my site, and it's a real pain to post in it because everytime I do it, I get TXT files from people using PCs (I use macs), and when I copy and paste that text into flash, it adds double the lines they used. So I have to edit them to take out all the extra spaces.
If that wasn't bad enough, The titles and content use different fonts and different sizes, so they're two different static textfields. And to set each posting apart from the other, I added a line between them. But for it to look good, this has to be in the exact middle between the end of one post, and the next post's title. But since each post has a different size, it's also a pain to measure that distance everytime I add a post. So I was thinking, one way for me to solve all this is to make a movieclip which does all the calculations by itself, and draws text from an external textfile. Maybe using HTML text I can have two different fonts and sizes in one textfield, instead of two?
Anyway, what I want is to just get the new post from people, paste the new text inside the TXT file, overwrite the one on the server with it and voil, that way I don't even have to open flash when adding new posts.
Anyone have a good way to do this? And then, for extra coolness, maybe if I get this working, I could make a page where the posters could log in and post...this page would save the post to the txt and that would make posting a lot easier because then they don't need me to post!
I am having trouble embedding a SWF file that I created into my blog page. I tried to upload it to sites.google.com but the direct link to the SWF file is hidden behind an https:// that I can't get rid of and other people can't see it. How can I embed a SWF into blogger?
View 4 RepliesWhat is the best way to go about creating a form that is either hooked to an email account or a database, and also I need to create a blog.
View 2 RepliesI remember doing some work where I put a dynamically changing PHP page into flash, I'm curious can the same be done by cutting out the PHP programming? I'm new to AS3 so I'm not sure what the protocol is now.Previously the hierarchy looked something like this.1. Input done on upload.php2. upload.php pass information through a handler.php3. handler.php outputs data.xml4. site.swf imports and uses information from data.xml to display blog
View 3 RepliesI just posted about an hour ago and I realized that there's a better way to explain what i'm trying to do. Basically, i'm wondering if there's a way to create a blog in a flash site.
View 13 RepliesI need to have an existing blog that can be viewed from within a Flash web page. The idea is to access and read a blog without leaving the Flash site. I have seen a widget on Flash Den that does this but only works in AS 3.0 The Flash site that needs the blog was done in AS 2.0. I would think this could be done in AS 2.0
View 4 Repliesim trying to create a flash blog but am alittle overwelld by all the options out there. i say this tutorial [URL] it shows u how to make a blog in as2 ( im trying to use as3) using cakephp and SWX but some have told me that thats not actually the best way to do it.
View 3 RepliesI'm currently building a flash website for uni, but I want to show my blog on the site. I'm currently using something called cutenews. CuteNews uses php but does not require a msql database. The page that contains my blog entries located here:
[URL]
I use this script to display my blog on my current website made in dreamwever:
Code:
<?PHP
include('path/to/show_news.php');
?>
I want to be able to display my blog on a dynamic text field in flash. I've tried loads of tutorials but cannot seem to get this working.
Is this as simple as using an XML image gallery's setup? The thing is, for a school project we can do whatever we want, but there has to be a blog. Since we want to make our site in Flash, I had this thought to use XML so my other team members (who have no clue on how to work with flash) could just as easily update the XML file and we have our "blog". Now the way I had this in mind (but I'm not that experienced with XML) is I have a movieClip container which would be added at every new XML line. Within this movieClip there would be a textField to fill with our babbling and a sprite/movieClip which will hold an image. That's about it.
View 12 RepliesI am having an issue with using BitmapData.draw(stage). I am getting the following error:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:
var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.